Project

General

Profile

« Previous | Next » 

Revision 4959

Added by daigle about 15 years ago

Added generic scheduler and workflow scheduling functionality.

View differences:

BaseAccess.java
27 27

  
28 28
package edu.ucsb.nceas.shared;
29 29

  
30
import java.sql.PreparedStatement;
31 30
import java.sql.ResultSet;
32 31
import java.sql.SQLException;
33 32

  
34 33
import edu.ucsb.nceas.metacat.DBConnection;
35 34
import edu.ucsb.nceas.metacat.DBConnectionPool;
36 35

  
37
public class BaseAccess {
36
public abstract class BaseAccess {
38 37
	
39 38
	protected DBConnection conn = null;
40 39
    protected int serialNumber = -1;
41
    protected PreparedStatement pstmt = null;
42 40
    protected ResultSet rs = null;
43 41
	
44 42
    protected BaseAccess(String methodName) throws AccessException {
......
53 51
    	}
54 52
    }
55 53
    
56
    protected ResultSet select(PreparedStatement pstmt) throws AccessException {
57
    	try {
58
    		pstmt.execute();
59
        	rs = pstmt.getResultSet();
60
    	} catch (SQLException sqle) {
61
    		throw new AccessException("Could not perform select: " + pstmt.toString()
62
    				+ sqle.getMessage());
63
    	}
64
    	
65
    	return rs;
66
    }
54
    protected abstract BaseDAO populateDAO(ResultSet resultSet) throws SQLException ;
67 55
}

Also available in: Unified diff