package oracle;
import java.sql.*;
public class OracleDB
{
public static void main(String[] args)
{
ResultSet rs = null;
System.out.println("asdfasdf");
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch (ClassNotFoundException ex) {
System.out.println("driver error");
}
try {
Connection con = DriverManager.getConnection(
"jdbc:oracle:thin:@192.168.88.80:1521:oracle9", "username",
"password");
Statement st = con.createStatement();
rs = st.executeQuery("select * from stu");
} catch (SQLException ex) {
System.out.println("con error");}
try
{
while(rs.next())
{
System.out.println(rs.getInt("id") + rs.getString("name"));
}
}
catch(Exception e){System.out.println("rs error");}
}
}