|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
We are facing connectivity problem while connecting to MySQL Database through servlets. We can connect to it via Telnet. The code being used is as follows :
********************************************************* import java.sql.*; public final class EstablishConnection { private EstablishConnection() {} public static Connection con; public static void connectDB() { try { if (con == null | | con.isClosed()) { try { Class.forName("org.gjt.mm.mysql.Driver"); String url = "jdbc:mysql://Host:3306/Database_Name"; con = DriverManager.getConnection(url, "user", "password"); } catch(ClassNotFoundException cnfe){} catch(SQLException sqle){} } } catch (SQLException sqle) {} } } ************************************************************ Even after making the changes to code it still don't work. Class.forName("org.gjt.mm.mysql.Driver").newInstance(); //String url = "jdbc:mysql://HOST:3306/DBNAME"; con = DriverManager.getConnection("jdbc:mysql://HOST/DBNAME?user=USER&password=PASSWORD"); Please tell is there any server side settings which is required to make the Driver run. [This message has been edited by fusion35 (edited October 31, 2000).] [This message has been edited by fusion35 (edited October 31, 2000).] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > MySql+Servlets Connectivity |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|