java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse

What is wrong with the code there are lots of error while debugging. I am writing a code for a singleton class to connect with the database mysql. Here is my code package com.glomindz.mercuri.util; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; public class MySingleTon { String url = “jdbc:mysql://localhost:3306/”; String dbName = “test”; String … Read more

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

So, you have a com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurejava.net.ConnectException: Connection refused I’m quoting from this answer which also contains a step-by-step MySQL+JDBC tutorial: If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn’t reachable at all. This can have one or more of the following causes: IP … Read more

DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001

I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine. When trying to connect from a remote server using JDBC I am getting the “Connection refused. ERRORCODE=-4499, SQLSTATE=08001” error. Based on information found here https://www-304.ibm.com/support/docview.wss?uid=swg21403644 I have confirmed that [[email protected] ~]$ db2set -all [i] DB2COMM=TCPIP [i] DB2AUTOSTART=YES [g] DB2SYSTEM=db2.xxxx.com [g] … Read more

DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704

I created local database in DB2 called “TestDB” then I created table called “TestTable“.I found that the table is put under schema name is “yasmin“.I am trying to connect to the DB2 database using JDBC but I got this exception R SQLException information [1/4/14 11:32:59:289 EST] 0000004d SystemErr R Error msg: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.TESTTABLE, DRIVER=3.61.86 [1/4/14 … Read more

java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Exception occurring. Why?

I have created an MS Access database and assigned a DSN to it. I want to access it through my Java application. This is what I am doing: public class AccessDbConnection { public static void main(String[] args) { System.out.println(“**ACCESS DB CONNECTION**”); try { Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); // for MS Access … MS access driver loading String conURL … Read more