Changeset 320
- Timestamp:
- 02/27/10 20:02:04 (2 years ago)
- Location:
- trunk/org.bridgedb.rdb.construct/src/org/bridgedb/rdb/construct
- Files:
-
- 2 modified
-
GdbConstruct.java (modified) (2 diffs)
-
GdbConstructImpl3.java (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.bridgedb.rdb.construct/src/org/bridgedb/rdb/construct/GdbConstruct.java
r317 r320 32 32 * @return 1 if addition was successful, 0 otherwise. 33 33 */ 34 public int addGene(Xref ref , String bpText);34 public int addGene(Xref ref); 35 35 36 36 /** … … 67 67 /** 68 68 * Excecutes several SQL statements to create the tables and indexes in the database the given 69 * connection is connected to 70 * Note: Official GDB's are created by Alex Pico's script, not with this code. 71 * This is just here for testing purposes. 69 * connection is connected to. 72 70 */ 73 abstract public void createGdbTables() ;71 abstract public void createGdbTables() throws IDMapperException; 74 72 73 abstract public void commit() throws IDMapperException; 74 75 abstract public void finalize() throws IDMapperException; 75 76 } -
trunk/org.bridgedb.rdb.construct/src/org/bridgedb/rdb/construct/GdbConstructImpl3.java
r317 r320 51 51 52 52 /** {@inheritDoc} */ 53 public int addGene(Xref ref , String bpText)53 public int addGene(Xref ref) 54 54 { 55 55 //TODO: bpText is unused … … 62 62 } 63 63 catch (SQLException e) 64 { 65 // Logger.log.error("" + ref, e); 64 { 66 65 return 1; 67 66 } … … 79 78 pstAttr.executeUpdate(); 80 79 } catch (SQLException e) { 81 // Logger.log.error(attr + "\t" + val + "\t" + ref, e);82 80 return 1; 83 81 } … … 97 95 pstLink.executeUpdate(); 98 96 } 99 catch (SQLException e) 100 { 101 // Logger.log.error(left + "\t" + right , e); 97 catch (SQLException e) 98 { 102 99 return 1; 103 100 } … … 177 174 * Note: Official GDB's are created by AP, not with this code. 178 175 * This is just here for testing purposes. 179 */ 180 public void createGdbTables() 176 * @throws IDMapperException 177 */ 178 public void createGdbTables() throws IDMapperException 181 179 { 182 180 // Logger.log.info("Info: Creating tables"); … … 184 182 { 185 183 Statement sh = con.createStatement(); 186 sh.execute("DROP TABLE info"); 187 sh.execute("DROP TABLE link"); 188 sh.execute("DROP TABLE datanode"); 189 sh.execute("DROP TABLE attribute"); 190 } 191 catch(SQLException e) 192 { 193 // Logger.log.error("Unable to drop gdb tables (ignoring): " + e.getMessage()); 194 } 195 196 try 197 { 198 Statement sh = con.createStatement(); 184 // sh.execute("DROP TABLE info"); 185 // sh.execute("DROP TABLE link"); 186 // sh.execute("DROP TABLE datanode"); 187 // sh.execute("DROP TABLE attribute"); 188 // sh.close(); 189 190 // sh = con.createStatement(); 199 191 sh.execute( 200 192 "CREATE TABLE " + … … 222 214 " datanode " + 223 215 " ( id VARCHAR(50), " + 224 " code VARCHAR(50) " +216 " code VARCHAR(50), " + 225 217 " PRIMARY KEY (id, code) " + 226 218 " ) "); … … 238 230 catch (SQLException e) 239 231 { 240 // Logger.log.error("while creating gdb tables: " + e.getMessage(),e);232 throw new IDMapperException (e); 241 233 } 242 234 }
