Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- import java.io.*;
- import java.lang.*;
- import java.util.*;
- class Primer13 {
- static
- {
- try
- {
- Class.forName("com.ibm.db2.jcc.DB2Driver");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- public static void main (String argv[])
- {
- try
- {
- Connection con = null;
- String url = "jdbc:db2://localhost:50001/vstud";
- con = DriverManager.getConnection(url, "student", "abcdef");
- //Upit
- con.close();
- }
- catch (SQLException e)
- {
- System.out.println("SQLCODE: " + e.getErrorCode() + "SQLSTATE: " + e.getSQLState() + "PORUKA: " + e.getMessage());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement