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 rental;
- import java.sql.*;
- import javax.swing.JOptionPane;
- /**
- *
- * @author ECS
- */
- public class koneksi {
- Connection conn;
- public koneksi(){
- try{
- Class.forName("com.mysql.jdbc.Driver");
- conn =DriverManager.getConnection("jdbc:mysql://localhost/sewa","root","");
- } catch (Exception e){
- JOptionPane.showMessageDialog(null,"Koneksi Database Gagal !");
- }
- }
- Connection logon(){
- try{
- Class.forName("com.mysql.jdbc.Driver");
- conn =DriverManager.getConnection("jdbc:mysql://localhost/sewa","root","");
- } catch (Exception e){
- }
- return conn;
- }
- public static void main(String args[]){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement