Skip to content

Commit 076e8bb

Browse files
authored
jdbc java
1 parent 2df327d commit 076e8bb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

jdbc.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.sql.*;
2+
class OracleCon{
3+
public static void main(String args[]){
4+
try{
5+
Class.forName("oracle.jdbc.driver.OracleDriver");
6+
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@https://livesql.oracle.com/apex/f?p=590:24:52740311731:::24:P24_SESSION_ID:232624917839105925556124048487455802111&cs=3wTu6v1O9x8rg3MwHsag5xMY7fJz13pPwW1ZE8zGa2ltJsp5t6ksOiMgGiKKN4OF4j5o2pe1VG8XddSRwhwaZRg:xe","system"'oracle");
7+
Statement stmt=con.createStatement();
8+
ResultSet rs=stmt.executeQuery("select*from employee");
9+
while(rs.next())
10+
System.out.println(rs.getln(1)+" "+rs.getString(2)+" "+rs.getString(3));
11+
con.close();
12+
}
13+
catch(Exception e){
14+
System.out.println(e);
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)