Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package latihandatabase;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- *
- * @author rifqi
- */
- public class LatihanDatabase {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- try {
- // TODO code application logic here
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/latihan","root","");
- System.out.println(con);
- } catch (ClassNotFoundException | SQLException ex) {
- System.err.println(ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement