This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
jdbc odbc probelm
Posted by prashant on December 04, 2001 at 10:04 AM
Please give me details of how to create dsn name. I am deloping stand alone program. the test code is as follows. import java.sql.*; class Customer { public static void main(String args[]) { try{ System.out.println("Excuted"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); Connection con=null; System.out.println("Excuted1"); con = DriverManager.getConnection("Jdbc.Odbc.prashant","scott","tiger"); System.out.println("Connection established"); Statement smt=con.createStatement(); String str="Create table emp1 (emp_no varchar2(6),name varchar2(20),"+ "address varchar2(30))"; smt.executeUpdate(str); System.out.println("Table created"); } catch(Exception e) {System. out.println("Error message "+e);} } } after compiling this code and running it the exception is thrown which says so suitable driver after printin executed and executed1 plz replay me as fast as possible and send the ans to my mail. i will be very great full thank u
Replies:
|