• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in retrieving data from mysql database  RSS feed

 
Shashank Anand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please tell me what is wrong with this code which displays only 'hello world' and nothing else?
I am using netbeans version 6.5 and mysql 5.0
mysql is the default database. If I execute 'select firstname from emp_table' using sql editor, it displays the results correctly.


 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong is that you aren't writing the data from the result set to the response. You are using "System.out.println" to write it to the application server's logs instead.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!