daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Jun 17th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.sql.*;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) throws SQLException,
  6.             ClassNotFoundException {
  7.         Connection con = null;
  8.         try {
  9.             Class.forName("com.mysql.jdbc.Driver");
  10.             con = DriverManager.getConnection(
  11.                     "jdbc:mysql://url:3306/:jdbctest", "user",
  12.                     "pass");
  13.             if (!con.isClosed()) {
  14.                 System.out.println("success..");
  15.             }
  16.         } catch (SQLException e) {
  17.             System.out.println(e);
  18.         } catch (ClassNotFoundException e) {
  19.             System.out.println(e);
  20.         }
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top