编者在本文将主要为大家介绍Java与Oracle、DB2、Sql Server、Sybase、MySQL、PostgreSQL等数据库连接的方法。
1、Oracle数据库
- Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
- String url="jdbc:oracle:thin:@localhost:1521:orcl";
- //orcl为数据库的SID
- String user="test";
- String password="test";
- Connection conn= DriverManager.getConnection(url,user,password);



