Best practise to read/write database records with Java/Ajax

We plan to use JSP/Java on the server side and Ajax to communicate with the server instantly.
Assume a drop down box which should be filled by database content.
What's the best way to read/write data from/to backend database? Short How-to's are welcome?
Who is Participating?
drazen_nikolicConnect With a Mentor Commented:
You should try DWR ( "Direct Web Remoting - DWR allows Javascript in a browser to interact with Java on a server and helps you manipulate web pages with the results."

It is the powerful tool, which makes our JAVA developer life much easier, fighting with AJAX calls.
In short, you map your JAVA class in a DWR configuration file, and than in JavaScript you can call this JAVA class's method. Afterwards, the callback JavaScript (you have specified) is triggered with the responce - result from your JAVA class -e.g. list of Strings you will be able to put in your drop-down box, by using JavaScript. And all this is done using AJAX technology, but you do not have to know much about it. There is also a possibility to map not just simple JAVA objects, like String or Integer, but also any custom object with its attributes.

Check out and for the start. There are also a lot of articles on the net with DWR examples.

Hope that this helps. Regard...
laurin1Connect With a Mentor Commented:
Depends on what you are going to use it for. I use prototype for all my Ajax communication and scriptaculous for ajax drop-downs.
go4javaAuthor Commented:
Didn't know the Javascript Framework and either, so thank you for these interesting links.
I need it for a simple admin form: Reading some data records from MaxDB via JDBC and filling dropdowns and other form fields.
All Courses

From novice to tech pro — start learning today.