Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package latihandatabase;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. /**
  8.  *
  9.  * @author rifqi
  10.  */
  11. public class LatihanDatabase {
  12.  
  13.     /**
  14.      * @param args the command line arguments
  15.      */
  16.     public static void main(String[] args) {
  17.         try {
  18.             // TODO code application logic here
  19.             Class.forName("com.mysql.jdbc.Driver");
  20.             Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/latihan","root","");
  21.             System.out.println(con);
  22.         } catch (ClassNotFoundException | SQLException ex) {
  23.             System.err.println(ex);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement