Problem using mySql driver
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   deepak_uzagare
Posted On:   Monday, June 24, 2002 07:28 AM

With my connection code I get the following error Please help Code : try{ System.out.println("Inside openSession"); //Register mysql driver Class.forName("org.gjt.mm.mysql.Driver").newInstance(); System.out.println("Driver Registered") ; //Establish connection to the mysql database con1 = DriverManager.getConnection ("jdbc:mysql://172.16.10.50:3306/ddims", "root", ""); System.out.println("Connection 1 Established") ; //Register Oracle driver Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Registered") ; //Est   More>>

With my connection code I get the following error Please help

			

Code :

try{
System.out.println("Inside openSession");
//Register mysql driver
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
System.out.println("Driver Registered") ;

//Establish connection to the mysql database
con1 = DriverManager.getConnection ("jdbc:mysql://172.16.10.50:3306/ddims", "root", "");
System.out.println("Connection 1 Established") ;

//Register Oracle driver
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver Registered") ;

//Establish connection to the Oracle database
con = DriverManager.getConnection ("jdbc:oracle:thin:@172.16.2.50:1521:ncl", "ddims","sjk");
System.out.println("Connection 2 Established") ;
}catch(Exception e) {
System.out.println("Connection Failed "+ e.getMessage()) ;
}
Problem :

C: omcatwebappsddims2web-infclassesdms
In Back
Inside openSession
Connection Failed org.gjt.mm.mysql.Driver
Unable to load driver
java.lang.NullPointerException
at Back.executeQry(Back.java:73)
at Back.main(Back.java:17)
   <<Less

Re: Problem using mySql driver

Posted By:   AlessandroA_Garbagnati  
Posted On:   Monday, June 24, 2002 07:45 AM

Hi,

are your MySql JDBC Drivers in the classpath?
About | Sitemap | Contact