| View previous topic :: View next topic |
| Author |
Message |
Debbland1 General User


Joined: 24 Jan 2006 Posts: 26 Location: State College, PA USA
|
Posted: Mon Jan 30, 2006 1:00 pm Post subject: Can't load JDBC driver for MySQL database |
|
|
I could use some help! I am trying to connect to a MySQL database. Java, MySQL, and OpenOffice are all new to me so I am trying to create a simple test case by using OpenOffice to connect to a MySQL database - both located on my PC. I have successfully created a MySQL database but I can't seem to connect to it. I am running off of a Windows platform. I will eventually be using a Linux platform so I need to connect to the database using a JDBC connection instead of an ODBC connection.
I downloaded the mysql connector/j driver and unzipped the file. I opened OpenOffice Base, created a dummy Base database, and then selected OpenOffice.org Tools -Options from the menu bar. I selected Java, then Class Path, then Add Archive and selected the .jar file I had just unzipped. I closed Base and reopened.
Under the Database Wizard, I select Connect to an existing database and select MySQL from the list. I select "Connect using JDBC". The default port number is 3306 and the driver class is com.mysql.jdbc.Driver. When I click the Test Class command button, I get a message from Base saying "JDBC Driver Test The JDBC driver could not be loaded."
Can I test the class without specifying a database or a Server URL? If not, what should I put in these fields? Should I use "localhost" as the URL or "127.0.0.1"? What format should I use to input the database name?
If I can test the driver without populating the database name or Server URL then why can't I load the driver? The MySQL server is automatically started when I load Windows.
Thanks in advance for the help! |
|
| Back to top |
|
 |
ddougan General User

Joined: 13 Jan 2006 Posts: 21 Location: North Vancouver, BC, Canada
|
Posted: Tue Jan 31, 2006 10:24 am Post subject: |
|
|
| Which JDBC version are you using? I suggest that you get mysql-connector-java-5.0.0-beta.zip - it works for me, connecting to a Linux server. |
|
| Back to top |
|
 |
Debbland1 General User


Joined: 24 Jan 2006 Posts: 26 Location: State College, PA USA
|
Posted: Tue Jan 31, 2006 10:43 am Post subject: |
|
|
Hi - thanks for replying. I first tried the 5.0 beta version then the 3.1.12 version. I had the same error with both.
When you open Base and you get to step 3 - Set up connection to a MySQL database using JDBC, what do you enter in the fields?
Thanks for the help!! |
|
| Back to top |
|
 |
ddougan General User

Joined: 13 Jan 2006 Posts: 21 Location: North Vancouver, BC, Canada
|
Posted: Tue Jan 31, 2006 11:04 am Post subject: |
|
|
You should be able to successfully test the class without the other settings, from what I recall. I have the jar file in the lib/ext subdirectory of the Java installation - and I don't seem to have anything in the Class Path.
My jdbc settings are
mysql://servername:3306/dbname?overrideSupportsIntegrityEnhancementFacility=true
where servername and dbname are specific to your settings. The last piece is a suggestion I found on this forum to allow the use of relationships in a MySQL database. |
|
| Back to top |
|
 |
Debbland1 General User


Joined: 24 Jan 2006 Posts: 26 Location: State College, PA USA
|
Posted: Tue Jan 31, 2006 11:48 am Post subject: |
|
|
I'm still having problems. Could you tell me EXACTLY, field by field, what you enter when you start OpenOffice Base.
Starting on step 1. Select Database
What do you want to do?
I select "Connect to an existing database" and select MYSQL from the list.
NEXT
Step 2: How do you wnat to connect to your MySQL database?
I select Connect Using JDBC
NEXT
Step 3: Setup connection
Name of database: <blank>
Server URL: <blank>
Port Number: 3306
MySQL JDBC Driver Class: com.mysql.jdbc.Driver
I do not change any of the field contents. I click the Test Class button and I get the JDBC Driver could not be loaded. Same is true when I try to populate the fields on this form.
How do my forms and field values compare to yours? Thanks again for your time! |
|
| Back to top |
|
 |
ddougan General User

Joined: 13 Jan 2006 Posts: 21 Location: North Vancouver, BC, Canada
|
Posted: Tue Jan 31, 2006 11:53 am Post subject: |
|
|
OK. Before you go further, and assuming the jar is in the directory I indicated, close OOo down - and include the Quickstarter too. OOo may need a refresh before it picks up your changes.
Try that, then the "Test Driver" and let me know whether that worked.
Des |
|
| Back to top |
|
 |
Debbland1 General User


Joined: 24 Jan 2006 Posts: 26 Location: State College, PA USA
|
Posted: Tue Jan 31, 2006 12:45 pm Post subject: |
|
|
Well, it works now...
Turns out, I have not shutdown my laptop since I installed the driver. I did shut down base like instructed. But it never occurred to me until now to reboot.
Thanks SO much for your help and patience!
Deb |
|
| Back to top |
|
 |
ddougan General User

Joined: 13 Jan 2006 Posts: 21 Location: North Vancouver, BC, Canada
|
Posted: Tue Jan 31, 2006 12:57 pm Post subject: |
|
|
Deb,
It was probably the Quickstarter which caused the issue - it holds the exe in memory even if the modules are closed.
I'm glad you've got it running. I've been having lots of fun the last couple of weeks getting a database built to suit my needs.
Good luck!
Des |
|
| Back to top |
|
 |
skyblue Newbie

Joined: 02 Apr 2010 Posts: 4
|
Posted: Sat Apr 03, 2010 5:48 pm Post subject: Can't load JDBC driver for MySQL database |
|
|
two hours. Scouring forum after forum. Many google attempts. Search of both OO and MySQL sites.
Following the readme for this download. Put in the CLASSPATH. Changed the CLASSPATH. None of this made any difference.
But ddougan had the answer. Well done you.
Rather than putting the JAR file in my downloads folder (as is my normal practice) it needed to be in the /bin/ext directory - sorry I am in windows ..\bin\ext folder and it works.
Could someone change the readme to reflect what is required please. |
|
| Back to top |
|
 |
|