SQLserver2005:
String url="jdbc:sqlserver://192.168.1.91:1433;databaseName=tidyinfo";
String driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String username="sa1";
String password="123456";
MySql:
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root","1234");
}catch(Exception e){
e.printStackTrace();
}
Oracle:
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:ORCL","scott","tiger");
}catch(Exception e){
e.printStackTrace();
}