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 pert10;
- import java.io.*;
- import java.sql.*;
- /**
- *
- * @author LK09NU17UTY
- */
- public class ConnectionApp {
- public static void jalankan()
- {
- Connection com = null;
- try
- {
- String jdboDriver = "com.mysql.jdbc.Driver";
- Class.forName(jdboDriver);
- String url ="jdbc:mysql://localhost:3306/mahasiswa";
- String user="root";
- String pswd="";
- System.out.println("Mencoba menmabngun koneksi ke"+url+"'dengan user'"+user+"'password'"+pswd+"'...'");
- com= DriverManager.getConnection(url,user,pswd);
- System.out.println("Sukses");
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement