Common database JDBC direct connection

xiaoxiao2021-03-05  25

1. MySQL (http://www.mysql.com) mysql-connector-java-2.0.14-bin.jar; class.forname ("org.gjt.mm.mysql.driver); CN = DriverManager.getConnection ("JDBC: MySQL: // MyDBComputernameorip: 3306 / MyDatabaseName", SUSR, SPWD); 2. PostgreSQL (http://www.de.postgreSQL.org) pgjdbc2.jar; class.Forname ("Org.postgresql.driver "); Cn = drivermanager.getConnection (" JDBComputernameorip / mydatabaseName ", SUSR, SUSR, SPWD); 3. Oracle (http://www.racle.com/ip/deploy/database/oracle9i/) Classes12 .zip; class.forname ("Oracle.jdbc.driver.OracleDriver"); CN = DriverManager.getConnection ("JDBC: Oracle: Thin: @mydbcomputernameorip: 1521: OrCl", SUSR, SPWD); 4. Sybase (http: //jtds.sourceforge.net) JConn2.jar; class.forname ("com.sybase.jdbc2.jdbc.sybdriver"); cn = drivermanager.getConnection ("JDBC: Sybase: TDS: MyDbComputernameorip: 2638", SUSR, SPWD ); // (DBA "/" sql ") 5. Microsoft SQLServer (http://jtds.sourgeforge.net); class.forname (" Net.SourceForge.jtds.jdbc.driver " CN = Driv Ermanager.getConnection ("JDBC: JTDS: SQLServer: // MYDBComputernameorip: 1433 / Master", SUSR, SPWD); 6. Microsoft SQLServer (http://www.microsoft.com); Class.Forname ("com.microsoft. jdbc.sqlserver.SQLServerDriver "); cn = DriverManager.getConnection (" jdbc: microsoft: sqlserver: // MyDbComputerNameOrIP: 1433; databaseName = master ", sUsr, sPwd); 7. ODBC Class.forName (" sun.jdbc.odbc .Jdbcodbcdriver "); Connection CN = DriverManager.getConnection (" JDBC: ODBC: " SDSN, SUSR, SPWD); 8.DB2 Class.Forname (" com.ibm.db2.jdbc.net.db2driver "); string URL = "

转载请注明原文地址:https://www.9cbs.com/read-37552.html

New Post(0)