Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC BEAN AND SOURCE

 
Ivo Delver
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use a Javabean to connect to a mysql database.
im using the folowing bean':

now i want to implement this code into a jsp
but what am i doing wrong?

 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... since you didn't post any error messages, I'll just point out a few things I see wrong.
1. Your mysql code appears to be missing the class declaration statement, e.g. "public class mysql {". Maybe that's just a typo in your post?
2. Your "mysql" class does not define a method called connect(). It does have one called connected().
3. Statement.executeUpdate() returns an int, not a ResultSet.
Other than that, I suggest you post the exceptions you're getting so we can narrow it down more. Good luck.
 
Ivo Delver
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working know
Tnx alot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic