/* * This sample shows how to list all entries from the table dogs in the database * * It uses the JDBC Thin 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 TestCSUH { public static void main (String args []) throws SQLException, ClassNotFoundException { // Load the Oracle JDBC driver Class.forName ("oracle.jdbc.driver.OracleDriver"); try{ // Connect to the database //Here we are connecting to server bosack (134.154.11.126) at port 1521 and sid labdb Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@134.154.11.126:1521:labdb","lgrewe","lgrewe"); // Create a Statement Statement stmt = conn.createStatement (); // Select the all (*) from the table JAVATEST ResultSet rset = stmt.executeQuery("select * from dogs"); 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