how do i connect to mysql database using
java servlets . i want to use JdbcOdbcDriver..
i have written the following code which does not work .
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection(url);
String command="INSERT INTO RegistrationInfo VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement stmt=con.prepareStatement(command);
stmt.setString(1,loginId);
stmt.setString(2,password);
stmt.setLong(3,customerId);
stmt.setString(4,adminName);
stmt.setString(5,orgName);
stmt.setString(6,address1);
stmt.setString(7,address2);
stmt.setString(8,city);
stmt.setString(9,state);
stmt.setString(10,country);
stmt.setInt(11,zipcode);
stmt.setInt(12,phone1);
stmt.setInt(13,phone2);
stmt.setInt(14,fax);
stmt.setString(15,website);
stmt.executeUpdate();
}catch(Exception e) {
e.printStackTrace();
}
please help me .. ireally need it fast