当前位置: 首页 > 工具软件 > Altibase > 使用案例 >

timesten mysql_各种各样的jdbc数据库连接方式【目前关注Altibase和timesten】 | 学步园...

宿楚青
2023-12-01

转载地址:http://blog.csdn.net/inthirties/article/details/4782011

我其实非常不愿意做这个的,都是为了工作,写上吧

MySQL

Class.forName("com.mysql.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://host:port/database","user","password");

Oracle数据库(thin模式)

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@host:port:databse","user","password");

Timesten数据库(thin模式)

Class.forName("com.timesten.jdbc.TimesTenDriver");

Connection con = DriverManager.getConnection("jdbc:timesten:client:dsn=dsnname")

Microsoft SQL Server

Class.forName("net.sourceforge.jtds.jdbc.Driver ");

Connection con = DriverManager.getConnection("jdbc:jtds:sqlserver://host:port/database","user","password");

or

Connection con = DriverManager.getConnection("jdbc:jtds:sybase://host:port/database","user","password");

DB2

Class.forName("com.ibm.db2.jdbc.app.DB2Driver ");

Connection conn= DriverManager.getConnection("jdbc:db2://localhost:5000/sample",user,password);

Firebird

Class.forName("org.firebirdsql.jdbc.FBDriver");

Connection con = DriverManager.getConnection("jdbc:firebirdsql://host:port/fdb_file_path","user","password");

PointBase(Server)

Class.forName("com.pointbase.jdbc.jdbcUniversalDriver");

Connection con = DriverManager.getConnection("jdbc:pointbase:server://host:port/databasename","user","password");

HSQLDB(Server)

Class.forName("org.hsqldb.jdbcDriver");

Connection con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:port/mydb","user","password");

Derby

这个少有人听说吧,cloudscape 应该听说过吧,该项目由此衍生

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection con = DriverManager.getConnection("jdbc:derby://host:port//mydb","user","password");

Class.forName("org.apache.derby.jdbc.EmbeddedDriver");

Connection conn = DriverManager.getConnection("jdbc:derby:mynewDB", p);

cloudscape

Class.forName("com.cloudscape.core.JDBCDriver");

Connection conn = DriverManager.getConnection("jdbc:cloudscape:");

Class.forName("com.cloudscape.rmiJdbc.RJDriver");

Connection conn = DriverManager.getConnection("jdbc:rmi://:/jdbc:cloudscape:", user, passoword);

Postgresql

Class.forName("org.postgresql.Driver");

Connection con=DriverManager.getConnection("jdbc:postgresql://host:port/database","user","password");

Informix

Class.forName("com.informix.jdbc.IfxDriver").newInstance();

Connection con=DriverManager.getConnection("jdbc:informix-sqli://host:port/myDB:INFORMIXSERVER=myserver","user","password");

Access

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;

Connection con=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=mdb的文件路径","user","password");

Sybase

Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();

Connection con=DriverManager.getConnection("jdbc:sybase:Tds:host:port?ServiceName=databasename","user","password");

==================附加======================

IBM AS400主机在用的JDBC语法

Class.forName("com.ibm.as400.access.AS400JDBCConnection");

Connection con = DriverManager.getConnection("jdbc:as400://IP","user","passwor");

Sapdb

Class.forName("com.sap.dbtech.jdbc.DriverSapDB");

Connection con = DriverManager.getConnection("jdbc:sapdb://host:port/DB_NAME","user","passwor");

Progress

Class.forName("com.progress.sql.jdbc.JdbcProgressDriver");

Connection con = DriverManager.getConnection("jdbc:JdbcProgress:T:dbserver:3305:liveappl","user","passwor");

Mimer SQL Local

Class.forName("com.mimer.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mimer:multi1","user","passwor");

Altibase

内存数据库

Class.forName("Altibase.jdbc.driver.AltibaseDriver");

Connection con = DriverManager.getConnection("jdbc:Altibase://host:port/dbname","user","passwor");

solid DB

上面还有这个有没有印象呀,如果持续关注我的文章的话,在我讲Timesten提到过这两个,还有一个eXtremeDB没有JDBC的支持

Class.forName("solid.jdbc.SolidDriver");

Connection con = DriverManager.getConnection("jdbc:solid://yourdbhost:1964/yourdbusername/yourdbpassword");

 类似资料: