Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes JDBC BEAN AND SOURCE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC BEAN AND SOURCE" Watch "JDBC BEAN AND SOURCE" New topic
Author

JDBC BEAN AND SOURCE

Ivo Delver
Greenhorn

Joined: Jan 20, 2003
Posts: 7
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

Joined: Sep 13, 2002
Posts: 331
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.


Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
Ivo Delver
Greenhorn

Joined: Jan 20, 2003
Posts: 7
It is working know
Tnx alot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC BEAN AND SOURCE