469,127 Members | 1,279 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

Java in Eclipse - MySQL Non Registering Driver when connecting to database

Hi Guys,

I am using Java in Eclipse to create tables in a MySQL Database. Everything has been working fine until it inexplicably stopped working the other day. My code runs but nothing happens to the database due to an error when I try to initialise the connection. The code actually runs to the end, the error is only viewable when I step through the code.

This is the constructor of my TableCreator class:

Expand|Select|Wrap|Line Numbers
  1. public TableCreator() throws SQLException {
  2.         host = "jdbc:mysql://localhost:3306/test";
  3.         dbName = "root";
  4.         dbPass = "pass";
  5.         conn = DriverManager.getConnection(host, dbName, dbPass);
  6.         query = conn.createStatement();
  7.         initialise();
  8.         System.out.println("Success.");
  9.     }
The error occurs on the line 'conn = DriverManager.getConnection(host, dbName, dbPass);'.

The stack looks like this just after I have attempted to execute this line:

TableCreator (1) [Java Application]
biz.cogitare.gpsperformancetool.TableCreator at localhost:53389
Thread [main] (Suspended)
Driver(NonRegisteringDriver).connect(String, Properties) line: 306
DriverManager.getConnection(String, Properties, Class<?>) line: not available
DriverManager.getConnection(String, String, String) line: not available
TableCreator.<init>() line: 23
TableCreator.main(String[]) line: 49
Daemon Thread [Abandoned connection cleanup thread] (Running)
C:\Program Files\Java\jre1.8.0_45\bin\javaw.exe (9 Jul 2015 12:27:27)

I have spent many hours searching the internet for help on how to fix this but so far I have been unsuccessful.

Any help would be greatly appreciated.

Jul 9 '15 #1
0 1373

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by sridhar nagabhurshana | last post: by
2 posts views Thread by Claude Schneegans | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.