Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@<HOST NAME>:<PORT>:<SID>", "USER","PASS");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(" YOUR QUERY HERE- SELECT " )
OR
st.executeUpdate(" DML/DDL Statement");
Place classes12.zip in your classpath before execution