import java.io。*;
import oracle.jdbc。*;
公共类JdbcApp6
{
public static void main(String[] args)throws Exception
{
OracleDriver driver=new OracleDriver();
Connection con=DriverManager.getConnection("jdbc:odbc:thin:@localhost:1521:orcl","shaheena","shaheena");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from sss");
System.out.println("SSNO SNAME SBRANCH SADDR ");
System.out.println("---------------------------------");
while(rs.next())
{
System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getFloat(3)+" "+rs.getString(4));
}
con.close();
}
}
答案 0 :(得分:0)
你需要
import java.sql.DriverManager;