Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class ExampleReport
- {
- public ExampleReport () {}
- public Connection bukakoneksi () throws SQLException
- {
- Connection con = null;
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection("jdbc:mysql://localhost/absensi","root","");
- return con;
- }
- catch (SQLException se)
- {
- System.out.println("No Connection Open");
- return null;
- }
- catch (Exception ex)
- {
- System.out.println("Couldn't open connection"+ex);
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement