init 2
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class TestOracleJDBC {
|
||||
public static void main(String[] args) {
|
||||
String jdbcUrl = "jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam";
|
||||
String username = "sisvietnam";
|
||||
String password = "sisvietnam";
|
||||
|
||||
try {
|
||||
Connection connection = DriverManager.getConnection(jdbcUrl, username, password);
|
||||
System.out.println("Connection successful!");
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Connection failed!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user