class Employee
{
public static void main (String args [])
throws SQLException
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@dlsun511:1721:dbms733",
"scott", "tiger"); // Create a Statement
Statement stmt = conn.createStatement (); // Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP"); // Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}
{
public static void main (String args [])
throws SQLException
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@dlsun511:1721:dbms733",
"scott", "tiger"); // Create a Statement
Statement stmt = conn.createStatement (); // Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP"); // Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货