Subversion Repositories XServices

Rev

Rev 72 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72 Rev 113
Line 44... Line 44...
44
	private Connection conn = null;
44
	private Connection conn = null;
45
	private final Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
45
	private final Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
Line 46... Line 46...
46
	
46
	
47
 
47
 
48
	public Connection getConnection() throws SQLException {
48
	public Connection getConnection() throws SQLException {
49
		if( conn!= null && conn.isValid(5)) {
49
		if( conn!= null ) { // Todo: && conn.conn.isValid(5)) {
50
			logger.debug("Checking tables on pre-exisiting database connection.");
50
			logger.debug("Checking tables on pre-exisiting database connection.");
51
			checkTables();
51
			checkTables();
52
			return conn;
52
			return conn;
Line 152... Line 152...
152
				}
152
				}
153
			}
153
			}
154
		}
154
		}
Line 155... Line 155...
155
	
155
	
156
	private synchronized boolean isConnected(boolean fail) throws SQLException {
156
	private synchronized boolean isConnected(boolean fail) throws SQLException {
157
		if(conn!=null && conn.isValid(5)) {
157
		if(conn!=null ) { // Todo: && conn.conn.isValid(5)) {) {
158
			return true;
158
			return true;
159
		} else {
159
		} else {
160
			String t = this.getClass().getClassLoader().getResource("/").toString().substring(6); // WEB-INF/classes
160
			String t = this.getClass().getClassLoader().getResource("/").toString().substring(6); // WEB-INF/classes
161
			t += "../data/db";
161
			t += "../data/db";