import java.sql.*;
public class OracleLoadDriver {
public static void main(String[] args)
throws ClassNotFoundException, SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@localhost:1521:xe";
jdbc:oracle:thin:@host:port:SID
Connection conn =
DriverManager.getConnection(url,"bolortuul","boloroo");
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
ResultSet rset =
stmt.executeQuery("select * from userss");
while (rset.next()) {
System.out.println (rset.getString(1));
}
stmt.close();
}
}
No comments:
Post a Comment