Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Lab4 {
- public static void main(String[] args) {
- Connection conn = null;
- try {
- // db parameters
- String url = "jdbc:mysql://mysql.cs.wwu.edu:3306/<fuented2>?useSSL=false";
- String user = "fuented2";
- String password = "'}410aD*KB4";
- // create a connection to the database
- conn = DriverManager.getConnection(url, user, password);
- // more processing here
- // ...
- } catch(SQLException e) {
- System.out.println(e.getMessage());
- }
- finally {
- try{
- if(conn != null)
- {
- conn.close();
- }
- }
- catch(SQLException ex){
- System.out.println(ex.getMessage());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement