Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BaseDAO implements DAO {
- final Logger resultLog = Logger.getLogger(BaseDAO.class);
- static final String driver = DBTools.propertieReader("driver");
- String url = DBTools.propertieReader("url");
- String username = DBTools.propertieReader("username");
- String password = DBTools.propertieReader("password");
- public Connection getConnection() throws DAOException {
- try {
- return DriverManager.getConnection(url, username, password);
- } catch (SQLException e) {
- String SQLmessage = e.getMessage();
- String SQLstate = e.getSQLState();
- int vendorcode = e.getErrorCode();
- resultLog.error("An excetion hasse occured");
- resultLog.error("Message : " + SQLmessage);
- resultLog.error("Sate : " + SQLstate);
- resultLog.error("VendorCode : " + vendorcode);
- } catch (Exception e) {
- throw new DAOException();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement