Created
May 16, 2019 14:32
-
-
Save leanhboi1999/de943158c78ab5deb97c33b0cf2d0c0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package learn; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
public class OracleConnection { | |
public static void main(String[] args) { | |
try { | |
String strConn="jdbc:oracle:thin:@localhost:1521/orcl"; | |
Connection conn=DriverManager.getConnection(strConn,"QLTV","123456"); | |
//Link + user + password | |
if(conn!=null) { | |
System.out.println("Kết nối thành công"); | |
} | |
else { | |
System.out.println("Kết nối thất bại"); | |
} | |
} catch (Exception e) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment