/**Oracle*/
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl;
String user="system";
String pwd="manager12345";
java.sql.Connection conn=DriverManager.getConnection(url,user,pwd);
/**Sybase**/
Class.forName("com.sybase.jdbc.SybDriver").newInstance();
String url="jdbc:sybase:Tds:localhost:5007/erp";
Properties sysProps=System.getProperties();
Sysprops.put("user","sa");
Sysprops.put("password","");
java.sql.Connection conn=DriverManager.getConnection(url,SysProps);
/**DB2**/
Class.forName("com.ibm.db2.jdbc.app.DB2Driver").newInstance();
String url="jdbc:db2://localhost:5000/sample;
String user="admin";
String pwd="";
java.sql.Connection conn=DriverManager.getConnection(url,user,pwd);
/**Informix**/
Class.forName("com.informix.jdbc.InxDriver").newInstance();
String url="jdbc:informix-sqli://localhost:1533/test:INFORMIXSERVER=infserver;
String user="sa";
String pwd="pwd";
java.sql.Connection conn=DriverManager.getConnection(url,user,pwd);
/**sql server**/
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs;
String user="sa";
String pwd="";
java.sql.Connection conn=DriverManager.getConnection(url,user,pwd);
/**PostgreSQL**/
Class.forName("org.postgresql.Driver").newInstance();
String url="jdbc:postgresql://localhost/netshop;
String user="root";
String pwd="";
java.sql.Connection conn=DriverManager.getConnection(url,user,pwd);
相关文章
- (转) java 通过 jdbc 链接 ms sql server 中出现 "no suitable driver for ..."
- 微信小程序 实现websocket长连接 以及断开连接之后自动重连
- 雨露均沾的OkHttp—WebSocket长连接的使用&源码解析
- 实现单台测试机6万websocket长连接
- Spring+Stomp+ActiveMq实现websocket长连接
- Django websocket 长连接使用
- nginx并发连接控制模块ngx_http_limit_conn_module
- sql server数据库操作
- 现在的SQLSERVER数据库监控软件有哪些?
- AspNet Core :创建自定义 EF Core 链接数据库