Link to home
Start Free TrialLog in
Avatar of yapsing
yapsingFlag for Malaysia

asked on

Tomcat 5.5, JDBC, MySQL 5.0 configuration and getConnection differences

Hi All,

I'm upgrading my Tomcat installation and updating all old versions of JDBC connector with connector/j and using the latest MySQL DB which is 5.0.

Tomcat is working fine because my *.jsp pages loaded just fine. and i'm sure the problem is with my connector/j.

I did all that before with the help of a book. I lost the book and formatted my PC. I can seem to be placing the JAR in the correct places.

i created a root directory C:\jdbc and set the CLASSPATH C:\jdbc copied the JAR file into common\lib inside Tomcat.

what are the differences between:
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                                 and
Class.forName("com.mysql.jdbc.Driver").newInstance();

i used
jdbc:mysql://127.0.0.1:8080/DSA <--name of my DB (is this worng?)

i created a simple file to test the connection by retrieving some data from MySQL but when i ran the file it gave me a bunch or errors.
i can post the errors if u want.

thanks.
Avatar of suprapto45
suprapto45
Flag of Singapore image

Hi,

Are you sure that the port of your MySQL DB is 8080?

Can you post the error stacktrace?

David
>>"what are the differences between:
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                                 and
Class.forName("com.mysql.jdbc.Driver").newInstance();"

If I am not mistaken, the first one is used in the older version of the Driver but I may be incorrect ;)

David
Avatar of yapsing

ASKER

I'm sori to tell you i have settled the problem. the default port is 3306. i got it after looking for solutions before posting my questions here. bits and pieces helped...

anyway i'm willing to give away the points if you can give me a good explanation on the differences on
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                                 and
Class.forName("com.mysql.jdbc.Driver").newInstance();"

for as far as i'm concern, these folders exist and works either way.
ASKER CERTIFIED SOLUTION
Avatar of suprapto45
suprapto45
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yapsing

ASKER

oh is that it? though not very satisfying but ok...
thanks for the grade