We would like to know how to connect to Oracle thin client.
//from ww w.j a v a 2s. c o m import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class Main { public static void main(String[] argv) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Oracle driver registered"); Connection conn = null; conn = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:orclh", "scott", "tiger"); Statement stmt = conn.createStatement(); ResultSet r = stmt.executeQuery("Select * from emp"); while (r.next()) { String str = r.getString("ename"); System.out.println(str); } } }