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 com.ruslan.fahmi.login;
- import com.mysql.jdbc.Connection;
- import com.mysql.jdbc.Statement;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- *
- * @author Ruslan
- */
- public class Koneksi {
- public Connection con;
- public Statement ss;
- String driverName = "com.mysql.jdbc.Driver";
- String url = "jdbc:mysql://localhost:3306/db_kyojin_karate";
- String username = "root";
- String password = "";
- public void getKoneksi()
- {
- try {
- con = (Connection) DriverManager.getConnection(url, username, password);
- System.out.println("Koneksi Sukses ");
- ss = (Statement) con.createStatement();
- }catch (SQLException ex) {
- System.out.println("Koneksi Gagal");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement