
import java.sql.*;

public class testOJDBC {

	public static void main(String[] args)
	throws ClassNotFoundException, SQLException{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		String url = "jdbc:oracle:thin:@//L000019.exadime.com:1521/orcl.exadime.com";
		Connection conn = DriverManager.getConnection(url,"scott","tiger");
		conn.setAutoCommit(false);
		Statement stmt = conn.createStatement();
		ResultSet rset = stmt.executeQuery("select * from dept");
		while (rset.next()) {
			System.out.println(rset.getInt(1)+"  "+rset.getString(2)+"  "+rset.getString(3));  
		}
		stmt.close();
		System.out.println ("Success!");
	}
}

