/* * This sample shows how to list all entries from the table dogs in the database * * It uses the JDBC OCI8 driver. */ // You need to import the java.sql package to use JDBC import java.sql.*; //You need to import the math package import java.math.*; class Test { public static void main (String args []) throws SQLException, ClassNotFoundException { // Load the Oracle JDBC driver Class.forName ("oracle.jdbc.driver.OracleDriver"); // Connect to the database // You can put a database name after the @ sign in the connection URL. // Next parameter= login, Next = password Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@internetprog", "student", "cst336"); // Create a Statement Statement stmt = conn.createStatement (); // Select the all (*) from the table JAVATEST ResultSet rset = stmt.executeQuery ("select * from system.JAVATEST"); System.out.println(rset); // Iterate through the result and print the employee names while (rset.next ()) //get next row of table returned { for(int i=1; i