[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

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.
0
yapsing
Asked:
yapsing
  • 4
  • 2
1 Solution
 
suprapto45Commented:
Hi,

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

Can you post the error stacktrace?

David
0
 
suprapto45Commented:
>>"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
0
 
yapsingAuthor Commented:
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
suprapto45Commented:
Hi,

I do not see much differenes on that

Class.forName("org.gjt.mm.mysql.Driver").newInstance();
// used in old driver

Class.forName("com.mysql.jdbc.Driver").newInstance();
// used in the latest driver and the suggested way to do it

David
0
 
yapsingAuthor Commented:
oh is that it? though not very satisfying but ok...
0
 
suprapto45Commented:
thanks for the grade
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now