Hello friends,
i am trying to connect to mysql which available online through java with below code.
I can fine a jar which contains the com.imaginary.sql.msql.MsqlDriver which is used the program.
Can any body tell me how connect or whats the jar file needed for the below program and from where to download that jar file also.
Code for your ref:
import java.sql.*; class testjdbc { public static void main (String[] args) { try { // Step 1: Load the JDBC driver. Class.forName("com.imaginary.sql.msql.MsqlDriver") ; System.out.println("Driver loaded success"); // Step 2: Establish the connection to the database. String url = "jdbc:msql://www.abc.com:1114/mysql"; Connection conn = DriverManager.getConnection(url,"user1","password" ); System.out.println("test connection success"); } catch (Exception e) { System.err.println("Got an exception! "); System.err.println(e.getMessage()); e.printStackTrace(); } } }
Thanks in advance!
by
Anand