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 koneksi;
- /**
- *
- * @author EZHAKOVA1687
- */
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.Statement;
- public class Koneksi {
- public static Connection con;
- public static Statement stm;
- public static void main(String args[]){
- try {
- String url ="jdbc:mysql://localhost/Test_connect";
- String user="root";
- String pass="";
- Class.forName("com.mysql.jdbc.Driver");
- con =DriverManager.getConnection(url,user,pass);
- stm = con.createStatement();
- System.out.println("You Are Conected;");
- }
- catch (Exception e) {
- System.err.println("Conecting failed"
- + "" +e.getMessage());
- }
- }
- }
Add Comment
Please, Sign In to add comment