Import the Java. SQL. Connection;
Import the Java. SQL. DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
Import Java, SQL Statement;
Public class Ocracle Conn {
Public static void main (String [] args) {
Try {
The Connection conn=DriverManager
GetConnection (" JDBC: oracle: thin @ localhost: 1521: XE ", "user", "pass");
Sout (" successful Database connect ");
Statements STMT=conn. CreateStament ();
The ResultSet rs=STMT. ExecuteQuery (select * form empt, dept ");
While (rs), next ()) {
Sout (rs. Get string (" name ") + rs. Get int (" ID ") + rs. Get string (" department ")); }
Conn close ();
} the catch (SQL Exception e) {
Sout (e);
Sout (" Database connect error "+ um participant etmessage ());
}}}}//sout=System. Out. Println