| View previous topic :: View next topic |
| Author |
Message |
theking2 Newbie

Joined: 12 Apr 2006 Posts: 2
|
Posted: Wed Jul 05, 2006 12:51 am Post subject: The JDBC driver could not be loaded |
|
|
Trying to connect to a MySQL database in OOo Base. Upon Test class I get "JDBC Driver Test", "The JDBC driver could not be loaded."
What does this mean?
1) OOo cannot load the appropriate class(es)? SUN JRE not installed correctly?
2) Wrong JRE selected? SUN felt the need to install at least a dozen JREs on my PC.
2) Cannot connect to the database?
Many thanks for an understandable anser. |
|
| Back to top |
|
 |
r4zoli Super User

Joined: 17 May 2005 Posts: 570 Location: Budapest, Hungary
|
Posted: Wed Jul 05, 2006 1:56 am Post subject: |
|
|
if you want to connect to database outside of Base you must have a Mysql JDBC drivers (mysql-connector-java-3.xxxx ) installed on your machine, and registered Under Tools>Options>OpenOffice.org>Java.
Click on the ClassPath button.Then the button Add Archive.
After that you could connect to database, create new database
Under dataabase URL (the line that already says JDBC:) enter mysql://localhost/yourdatabse
use JDBC driver class: com.mysql.jdbc.Driver, test driver
check the Password Required box
and finish.
you could use ODBC driver too.
Bests,
Zoltan |
|
| Back to top |
|
 |
rowland Newbie

Joined: 26 Sep 2006 Posts: 3
|
Posted: Wed Sep 27, 2006 8:21 am Post subject: Connecting to mySQL via JDBC |
|
|
| r4zoli wrote: |
Under dataabase URL (the line that already says JDBC:) enter mysql://localhost/yourdatabse
use JDBC driver class: com.mysql.jdbc.Driver, test driver
|
This works for me, on Linux, running OO 2.0
But oy, this is not intuitive!
I notice on the first page of the wizars, the 'connect to existing' dropdown list has an option for MySQL. This leads to a fork - ODBC or JDBC. The JDBC fork has the driver class filled in already. That looks like a better route to take. |
|
| Back to top |
|
 |
keithclark1966 OOo Enthusiast

Joined: 18 Jan 2007 Posts: 189
|
Posted: Fri Jun 20, 2008 6:15 am Post subject: |
|
|
| r4zoli wrote: | if you want to connect to database outside of Base you must have a Mysql JDBC drivers (mysql-connector-java-3.xxxx ) installed on your machine, and registered Under Tools>Options>OpenOffice.org>Java.
Click on the ClassPath button.Then the button Add Archive.
After that you could connect to database, create new database
Under dataabase URL (the line that already says JDBC:) enter mysql://localhost/yourdatabse
use JDBC driver class: com.mysql.jdbc.Driver, test driver
check the Password Required box
and finish.
you could use ODBC driver too.
Bests,
Zoltan |
Where can one get that driver file? I am using PCLinuxOS and I cannot find it in the repositories.
Thanks,
Keith _________________ Open Office 3.0 under Ubuntu 9.04, XP and Vista |
|
| Back to top |
|
 |
r4zoli Super User

Joined: 17 May 2005 Posts: 570 Location: Budapest, Hungary
|
|
| Back to top |
|
 |
keithclark1966 OOo Enthusiast

Joined: 18 Jan 2007 Posts: 189
|
Posted: Fri Jun 20, 2008 6:57 am Post subject: |
|
|
Perfect, thanks!
Keith _________________ Open Office 3.0 under Ubuntu 9.04, XP and Vista |
|
| Back to top |
|
 |
keithclark1966 OOo Enthusiast

Joined: 18 Jan 2007 Posts: 189
|
Posted: Sun Jun 29, 2008 6:30 pm Post subject: |
|
|
This worked for my under Linux, but in Windows I get the following error when trying to connect still:
Cannot connect driver class com.mysql.jdbc.driver could not be loaded.
Keith _________________ Open Office 3.0 under Ubuntu 9.04, XP and Vista |
|
| Back to top |
|
 |
r4zoli Super User

Joined: 17 May 2005 Posts: 570 Location: Budapest, Hungary
|
Posted: Sun Jun 29, 2008 9:25 pm Post subject: |
|
|
| JDBC driver addad to classpath? |
|
| Back to top |
|
 |
keithclark1966 OOo Enthusiast

Joined: 18 Jan 2007 Posts: 189
|
Posted: Mon Jun 30, 2008 4:49 am Post subject: |
|
|
Yes, classpath driver added. Even stranger. I got it to work successfully, in Linux, for one user. I then switched users, installed the classpath driver but it will not work for that user. Same computer, same jdbc driver.
I tried everything on my XP machine to get it to work and I finally gave up with no luck.
Keith _________________ Open Office 3.0 under Ubuntu 9.04, XP and Vista |
|
| Back to top |
|
 |
danorton Newbie

Joined: 10 Jul 2008 Posts: 1
|
Posted: Thu Jul 10, 2008 3:43 pm Post subject: |
|
|
Well, no one mentioned it here, so hopefully this solves it for all of you.
When Open Office tells you to exit and reload, it fails to tell you that you have to exit all Open Office applications, even the ones that don't show up in the main task bar.
In my case, it was the "Quickstarter" applet. When I killed that and reloaded, all worked fine.
Reviewing, step-by-step:
1) Put mysql-connector-java-5.1.6-bin.jar anywhere you like
2) Load OpenOffice.org Writer and select Tools / Options / OpenOffice.org / Java
3) Select "Class Path"
4) Select "Add Archive"
5) Point to mysql-connector-java-5.1.6-bin.jar
6) Exit OpenOffice.org Writer/Base/Quickstarter &c &c
7) Load Base
8) Make sure class is com.mysql.jdbc.Driver
(you don't really need to specify the URL, yet)
9) Select "Test Class" |
|
| Back to top |
|
 |
seanoc5 Newbie

Joined: 28 Jul 2008 Posts: 1
|
Posted: Mon Jul 28, 2008 11:29 am Post subject: Wonderful: full restart solved the problem |
|
|
Thanks to OP for the hint about killing/restarting the OpenOffice activator on Windows (Vista). I suppose if I were not so lazy, or impatient, a full reboot would have also gotten me where I needed to be.
Sean |
|
| Back to top |
|
 |
pizzipie General User

Joined: 31 Jul 2008 Posts: 9
|
Posted: Thu Jul 31, 2008 11:07 am Post subject: JDBC connection to Mysql - Error message - making me crazy |
|
|
I have tried to connect to a mysql database with no success. Here is what I did.
1. Connect to existing database => MYSQL .. next
2. Connect using JDBC .. next
3. Name of database => pizzi_db
Server URL => mysql://localhost
Port Number | 3306 | default: 3306
Mysql JDBC driver class => com.mysql.jdbc.Driver
Test class => The JDBC driver was loaded sucessfully ... next
4. User name => rick
Password => required ... next
5. Yes - Register database
Yes - Open the database for editing ... Finish
6. Name => pizzi_db or any other
ODF database ... save
7. Tables => rick
password => rick ... ok
THEN the Problem: Receive following message.
"The connection to data source pizzi_db could not be established. Must specify port after ':' in connection string"
Can anyone help to solve this? Would greatly appreciate a solution.
Rick P |
|
| Back to top |
|
 |
r4zoli Super User

Joined: 17 May 2005 Posts: 570 Location: Budapest, Hungary
|
Posted: Fri Aug 01, 2008 3:48 am Post subject: |
|
|
Solution:
Server URL: localhost |
|
| Back to top |
|
 |
pizzipie General User

Joined: 31 Jul 2008 Posts: 9
|
Posted: Fri Aug 01, 2008 8:21 am Post subject: error message - specify port after ":" |
|
|
| r4zoli wrote: | Solution:
Server URL: localhost |
I knew the answer was simple.
Thanks very much r4zoli, you made my day!!!! |
|
| Back to top |
|
 |
milooo Newbie

Joined: 25 Oct 2008 Posts: 1
|
Posted: Sat Oct 25, 2008 5:03 am Post subject: connecting to mysql on external server |
|
|
found this thread with similar problems, could advance to create oo-database conncting file.
Thanks!
But... wanting to connect to an external database (http://www.keramikforum.info...)
What do I have to fill in
database name? (filled in its name on server)
dateabase url (filled in (http://www.keramikforum.info, like the hoster says)
portnumber (unchanged)
result:The connection to data source ... could not be established. Must specify port after ':' in connection string
the tooltip for the portnumber field says in german: specify url jdbc:mysql://servername/databasename, but I think this is ment for dB url. When I tried this there was an error message illegal: connection port value 'mysql:'
What has to be done?? |
|
| Back to top |
|
 |
|