Changeset 16258


Ignore:
Timestamp:
2008-07-01T15:39:13+12:00 (15 years ago)
Author:
xiao
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/sql/derby/DerbyDBWrapper.java

    r15948 r16258  
    3939        String key = (String)ite.next();
    4040        Object value = arow.get(key);
    41         logger.info(key + "=>" +value);
     41        //logger.info(key + "=>" +value);
    4242        if (value == null || value.equals("")) continue;
    4343        info.addInfo(key.toLowerCase(),sqlState.undoDBSafe(value));
     
    5858    public boolean openConnection(String databasepath){
    5959    connection = sqlServer.connect(databasepath);
     60   
    6061    if (connection == null) return false;
    6162
    6263    try{
     64        connection.setAutoCommit(false);   
    6365        statement = connection.createStatement();
    6466    }
     
    7375    public ArrayList executeQuery(String query_statement){
    7476    //the database hasn't been correct yet
    75     if (statement == null){
    76         logger.info("the database hasn't been correct yet");
    77         return new ArrayList();
    78     }
     77    try{   
     78       
     79        if (statement == null){
     80            logger.info("the database hasn't been correct yet");
     81            return new ArrayList();
     82        }
    7983   
    80     ArrayList results = new ArrayList();
     84        ArrayList results = new ArrayList();
    8185
    82     try{
    83        ResultSet rs = statement.executeQuery(query_statement);
    84        ResultSetMetaData rsmd = rs.getMetaData();
    85        int numOfColumns = rsmd.getColumnCount();
    86        while(rs.next()){
     86   
     87        ResultSet rs = statement.executeQuery(query_statement);
     88        ResultSetMetaData rsmd = rs.getMetaData();
     89        int numOfColumns = rsmd.getColumnCount();
     90        while(rs.next()){
    8791           HashMap arow = new HashMap();
    8892           for(int i = 1; i <= numOfColumns ; i++){
Note: See TracChangeset for help on using the changeset viewer.