Class.forName(“oracle.jdbc.driver.OracleDriver”);
Connection conn=DriverManager.getConnection( url , username , password );Statement stmt=conn.createStatement();String str=”select * from [table]”;ResultSet rs=stmt.executeQuery(str);While(rs.next()){ ……………………}rs.close();stmt.close();conn.close();