Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 23, 2012, 04:41:08 PM

Pages: [1]   Go Down
  Print  
Author Topic: connecting to MySQL with Connector/J  (Read 709 times)
folkxing
Spacescooter Operator
*****
Offline Offline

Posts: 36


« on: August 15, 2002, 05:46:00 AM »

OK, I just finished creating my database with MySQL.  Then, I tried to download the MM driver but it's been changed to Connector/J.  I downloaded Connector/J, but there is no installation file.  Can someone show me a solution to this.  I am trying to connect from a servlet.  Also, will Connector/J be installed on the Jupiter server.
Logged
tamer
Newbie
*
Offline Offline

Posts: 4


WWW
« Reply #1 on: August 15, 2002, 02:01:00 PM »

I don't know about Connector/J.  But I do know that the org.gjt.mm.mysql.Driver that is provided is working fine...so I suggest using that in your servlet/jsp(s).

Tamer
Logged
Max
Über Jedi
*****
Offline Offline

Posts: 2534



WWW
« Reply #2 on: August 15, 2002, 03:39:00 PM »

Meaning, you do not have to download the driver, it is already installed.
Logged
folkxing
Spacescooter Operator
*****
Offline Offline

Posts: 36


« Reply #3 on: August 21, 2002, 03:47:00 AM »

Alright, i am now using "org.gjt.mm.mysql.Driver"
However, I am getting an error 500:  NullPointerException.
My code is as follows:
------
Class.forName("org.gjt.mm.mysql.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost/webDB","admin","******");
------
Everything works fine when I switched back to my old driver using Access as my database:
------
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("JDBC:ODBC:NapDB","","");
------
This inicates that the rest of my code should be OK and that the problem has something to do with the mySQL.  With my old setup, my servlet knows where to locate my database because I told the system where it is during the ODBC setup.  In MySQL, how does the servlet know where to find my database?  I am a newbie to JSPs, Servlets, and MySql!  Could I be missing some steps?  What i did was I installed MySQL.  Then I installed mysqld-nt as a service.  Started the service.  Populated the database.  Gave it a username and password.    "[confused]"
Logged
folkxing
Spacescooter Operator
*****
Offline Offline

Posts: 36


« Reply #4 on: August 21, 2002, 03:53:00 AM »

Not sure if this is helpful towards a solution or not, but everytime I accessed that page and got an that error, the Resin command prompt spits out this line:

org.gjt.mm.mysql.Driver

Thus, I end up with a list of that same line repeating itself.
Logged
folkxing
Spacescooter Operator
*****
Offline Offline

Posts: 36


« Reply #5 on: August 21, 2002, 06:30:00 AM »

After more digging around and reading, I found out that I need to install the mm driver.  Everything is "A Okay" now. Thanks Tamer and Max for your help.  For those who need the driver it can be downloaded  here .
Logged
kianwatt
Pong! (the videogame) Master
*****
Offline Offline

Posts: 22


WWW
« Reply #6 on: September 15, 2002, 05:15:00 PM »

yes u need to install the driver and most likely just copy the mm.org..... jar file to the jdk installation directory being something like

C:\jdk1.3.1_01\jre\lib\ext
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: