This code here is connecting to odbc database and return the connection that can be used to perform DDL and DML operation.
Hitesh Agarwal http://www.hiteshagrawal.com On Sat, Aug 15, 2009 at 6:59 PM, Niteen Kumar <kumar.nit...@gmail.com>wrote: > refer to java doc api..you will get the answers... > http://java.sun.com/j2se/1.5.0/docs/api/ > > On Sat, Aug 15, 2009 at 12:19 AM, jatti <jatin_john1...@yahoo.com> wrote: > >> >> public Connection getConnection() >> { >> Connection con = null; >> try >> { >> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); >> con = >> DriverManager.getConnection("jdbc:odbc:TSMS","TSMS","TSMS"); >> System.out.println("Con : "+con); >> return con; >> } >> catch(Exception e) >> { >> System.out.println("Exception "); >> e.printStackTrace(); >> } >> return null; >> >> >> > > > -- > Thanks & Regards > Niteen Kumar > > > > > > -- Hitesh Agarwal http://www.hiteshagrawal.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---