I need sample code to read rows of data from a mysql table using java
A:
Here is a tutorial with sample code: http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm
vanje
2010-10-04 16:28:33
A:
A very simple tutorial: http://www.vogella.de/articles/MySQLJava/article.html
Google is your friend.
The Elite Gentleman
2010-10-04 16:33:44
A:
I wouldn't recommend using the JDBC API directly, it's error prone (sooner or later you forget to close a conection) and too verbose. There are many nice layers to use on top of JDBC. If you want to write SQL, I think Spring JDBCTemplate is nice. Or better, Groovy's SQL support (if you are just bound to 'Java the platform', not 'Java the language').
Then there are object relational mappers (ORM) where you don't need to write SQL. Take a look at Hibernate and JPA
rlovtang
2010-10-04 16:38:00
You're forgetting that the company writing database drivers uses JDBC.....
The Elite Gentleman
2010-10-05 10:43:46