Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Main {
- public static void main(String[] args) throws SQLException,
- ClassNotFoundException {
- Connection con = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection(
- "jdbc:mysql://url:3306/:jdbctest", "user",
- "pass");
- if (!con.isClosed()) {
- System.out.println("success..");
- }
- } catch (SQLException e) {
- System.out.println(e);
- } catch (ClassNotFoundException e) {
- System.out.println(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement