The following example connects user scott with password tiger to a database with SID orcl through port 1521 of host myhost, using the Thin driver.
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger")
If you are using Oracle as your database and want to upgrade your Java app to Java 5, think again! We just uncovered an Oracle JDBC driver bug. Here is how to reproduce it: