Gallery Posted by www.chennarapu.com Posted on December 18, 2013 Posted under JDBC Comments Leave a comment JDBC, Servlets and JSP Black Book download Link of Santosh Kumar K JDBC, Servlets and JSP Black Book download Link of Santosh Kumar K Share this:TwitterFacebookLike Loading...
Standard Posted by www.chennarapu.com Posted on November 17, 2012 Posted under JDBC Comments Leave a comment List of JDBC Drivers? 1) Oracle Thin Driver jdbcURL: jdbc:oracle:thin:@<HOST>:<PORT>:<SID> DriverName : oracle.jdbc.driver.OracleDriver Eg : Connection connection=null; try{ Class.forName(DriverName); connection=DriverManager.getConnection (“jdbc:oracle:thin:@localhost:SID”,”user”,”pass”); }catch(SQLException e){ e.printStackTrace();} note: we can get SID from tnsnames.ora file and we can put IP address in the place of local host eg: 122.122.122.122 2) JDBC ODBC Bridge Driver jdbcURL: jdbc:odbc:<DSN> DriverName : sun.jdbc.odbc.JdbcOdbcDriver Eg : Connection connection=null; try{ Class.forName(DriverName); connection=DriverManager.getConnection (“jdbc:odbc:DSN”,”user”,”pass”); }catch(SQLException e){ e.printStackTrace();} note: we can create DSN from Start->Settings->ControlPanel->AdministrativeTools->DataSource(ODBC) 3)Oracle OCI 8i Driver jdbcURL: jdbc:oracle:oci8:@<SID> DriverName : oracle.jdbc.driver.OracleDriver Eg : Connection connection=null; try{ Class.forName(DriverName); connection=DriverManager.getConnection (jdbcURL,”user”,”pass”); }catch(SQLException e){ e.printStackTrace();} note : we can get SID from tnsnames.ora files 4)Microsoft SQL Server jdbcURL: jdbc:weblogic:mssqlserver4:<DB>@<HOST>:<PORT> DriverName: weblogic.jdbc.mssqlserver4.Driver 5)Microsoft SQL Server 2000(Microsoft Driver) jdbc URL: jdbc:microsoft:sqlserver://<HOST>:<PORT>[;DatabaseName=<DB>] DriverName: com.microsoft.jdbc.sqlserver.SQLServerDriver 6)IBM DB2 jdbcURL : jdbc:db2://<HOST>:<PORT>/<DB> DriverName: com.ibm.db2.jdbc.app.DB2Driver 7)MySQL jdbcURL: jdbc:mysql://<HOST>:<PORT>/<DB> DriverName : org.gjt.mm.mysql.Driver 8. Sybase (jConnect 5.2) jdbc:sybase:Tds:<HOST>:<PORT> com.sybase.jdbc2.jdbc.SybDriver ******************************************************************** To test your driver once it’s installed, try the following code: { Class.forName(“Driver name”); Connection con = DriverManager.getConnenction(“jdbcurl”,”username”,”password”); //other manipulation using jdbc commands } catch(Exception e) { } Share this:TwitterFacebookLike Loading...