Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- try {
- String dbUrl="jbdc:mysql://localhost:8083/baza";
- String user="root";
- String pass="";
- Class.forName("com.mysql.jdbc.Driver");
- Connection veza=DriverManager.getConnection(dbUrl,user,pass);
- System.out.println("Uspostavljena je koneckcija izmedju baze i drivera");
- }catch(ClassNotFoundException e){
- System.out.println("Drajver nije ucitan!: "+e);
- }catch(SQLException sqle){
- System.out.println("Exception: "+sqle);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement