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 Main {
- static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
- static final String DB_URL = "jdbc:mysql://localhost/logiccompany";
- public static void main(String[] args) {
- try {
- Class.forName(JDBC_DRIVER);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- try {
- Connection conn = DriverManager.getConnection(DB_URL,"root","1997");
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment