Mysql:string driver= "Com.mysql.jdbc.Driver"; Driver String url= "Jdbc:mysql://localhost:3306/db_name"; The url,db_name of the connection is the database name String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). New Instance ();
Connection con=drivermanager.getconnection (Url,username,password); Microsoft SQL Server 2.0 driver (one of 3 jars): String driver= "Com.microsoft.jdbc.sqlserver.SQLServerDriver"; Methods for connecting to SQL databases String url= "Jdbc:microsoft:sqlserver://localhost:1433;databasename=db_name"; Db_name is the database name String username= "Username"; User name String password= "Password"; Password Class.forName (Driver). New Instance (); Loading data can drive Connection con=drivermanager.getconnection (Url,username,password); Microsoft SQL Server 3.0 driver (one of 1 jars)://Old Zi Zhu Perfect String driver= "Com.microsoft.sqlserver.jdbc.SQLServerDriver"; Methods for connecting to SQL databases String url= "Jdbc:microsoft:sqlserver://localhost:1433;databasename=db_name"; Db_name for dataLibrary name String username= "Username"; User name String password= "Password"; Password Class.forName (Driver). New Instance (); Loading data can drive Connection con=drivermanager.getconnection (Url,username,password); Sysbase:string driver= "Com.sybase.jdbc.SybDriver"; Driver String url= "Jdbc:sysbase://localhost:5007/db_name"; Db_name for the data can be named String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). newinstance ();
Connection con=drivermanager.getconnection (Url,username,password); Oracle (in thin mode): String driver= "Oracle.jdbc.driver.OracleDriver"; Ways to connect to a database String url= "Jdbc:oracle:thin: @loaclhost: 1521:ORCL"; ORCL is the SID String Username= "Username" for the database; User name String password= "Password"; Password Class.forName (Driver). newinstance ();
Load Database driver Connection con=drivermanager.getconnection (Url,username,password); Postgresql:string driver= "Org.postgresql.Driver"; Ways to connect to a database String Url= "Jdbc:postgresql://localhost/db_name"; Db_name for the data can be named String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). newinstance ();
Connection con=drivermanager.getconnection (Url,username,password); Db2:string driver= "Com.ibm.db2.jdbc.app.DB2.Driver"; Connecting the provider instance with DB2 client//string driver= "Com.ibm.db2.jdbc.net.DB2.Driver"; The connection provider instance String url= "Jdbc:db2://localhost:5000/db_name" that does not have a DB2 client; Db_name for the data can be named String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). newinstance ();
Connection con=drivermanager.getconnection (Url,username,password);
Informix:string driver= "Com.informix.jdbc.IfxDriver"; String url= "Jdbc:informix-sqli://localhost:1533/db_name:informixser=myserver"; Db_name for the data can be named String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). newinstance (); Connection COn=drivermanager.getconnection (Url,username,password);
Jdbc-odbc:string driver= "Sun.jdbc.odbc.JdbcOdbcDriver"; String url= "Jdbc:odbc:dbsource"; Dbsource for the data source name String username= "Username"; User name String password= "Password";
Password Class.forName (Driver). newinstance ();
Connection con=drivermanager.getconnection (Url,username,password);