473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.     }
  10.  
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.

Thanks!
Jul 9 '15 #1
0 1477

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

Similar topics

0
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong...
0
by: sridhar nagabhurshana | last post by:
hello I am trying to connect to mysql database using connector/J jdbc driver this is my code import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
2
by: Claude Schneegans | last post by:
Hi, The MySQL ODBC driver returns an error when calling SQLColumns function with an empty Table parameter: Can't use wildcards in table name Is there a newer version which supports wildcards...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
2
by: Mullin | last post by:
I need to generate a unique no. in the format like yyyymmddxxxxxx (xxxxxx 6-digitl running number) I think of create a table with two columns date value 20050405 120 20050406 99...
3
by: Rakesh | last post by:
Hi, I want to get connection to a DB2 database using the driver COM.ibm.db2.jdbc.DB2XADataSource. I have also included 'db2java.zip' in the classpath. However I am getting the exception ...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
2
by: WilHob | last post by:
Hello: I can not make connection to MySQL from Java. I set System Variable CLASSPATH to: C:\MySQL\mysql-connector-java-5.0.5\mysql-connector-java-5.0.5-bin.jar ... Then registered Driver:...
2
by: jith87 | last post by:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Ths s the error i get whn i try to connect to mysql using jdbc driver.....Can u help me out...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.