Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package database;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import javax.swing.JOptionPane;
- /**
- *
- * @author rayan
- */
- public class Database {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- String url="jdbc:mysql://localhost:3306/dblibrary";
- Connection cons=DriverManager.getConnection(url,"root","");
- JOptionPane.showMessageDialog(null,"Found Connection");
- } catch (Exception e)
- {
- JOptionPane.showMessageDialog(null, e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement