Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class Ex1 {
- public static void main(String[] args) throws ClassNotFoundException, SQLException {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String url="jdbc:oracle:thin:\"mvoronin\"/13091994@192.168.22.60:1521:orcl2";
- String usr="\"mvoronin\"";
- String pwd="66666666";
- Connection co=null;
- //Connection co = DriverManager.getConnection(url,usr,pwd);
- try{
- co = DriverManager.getConnection(url);
- }catch (Exception e) {
- System.out.println("pas de co");
- }
- if(co!=null){
- System.out.println("connecté!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement