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 MainMySql{
- private static final String driver = com.mysql.jdbc.Driver.class.getName();
- static String connectURL = "jdbc:mysql://localhost:3306/equities";
- public static void main(String[] args) {
- System.out.println(driver);
- try (Connection connection =
- DriverManager.getConnection(connectURL, "root", "password")){
- System.out.println("Connected");
- }
- catch (SQLException ex){
- System.err.println(ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement