Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.journaldev.jsf.util;
- import java.sql.Connection;
- import java.sql.DriverManager;
- public class DataConnect {
- public static Connection getConnection() {
- try {
- Class.forName("org.apache.derby.jdbc.ClientDriver");
- Connection con = DriverManager.getConnection(
- "jdbc:derby://localhost:1527/PataDB", "APP", "APP");
- return con;
- } catch (Exception ex) {
- System.out.println("Database.getConnection() Error -->"
- + ex.getMessage());
- return null;
- }
- }
- public static void close(Connection con) {
- try {
- con.close();
- } catch (Exception ex) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement