X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fstore%2FDbStore.java;fp=prod%2Fnet%2Fjaekl%2Fcfb%2Fstore%2FDbStore.java;h=b17a419626a69e4afbb692aaf01157df9fe3c3da;hp=e50f7403910830d798e7cd8ca1b3296f056f42bc;hb=a1378c84c773511e4ffe99fb419da67af188aff7;hpb=a59aa887766f250ba0ad0948c54e1a8d9a590a23 diff --git a/prod/net/jaekl/cfb/store/DbStore.java b/prod/net/jaekl/cfb/store/DbStore.java index e50f740..b17a419 100644 --- a/prod/net/jaekl/cfb/store/DbStore.java +++ b/prod/net/jaekl/cfb/store/DbStore.java @@ -32,7 +32,7 @@ public class DbStore { m_msgColl = msgColl; } - public Analysis getPrior(Analysis analysis) throws SQLException, TypeMismatchException { + public Analysis getPrior(Analysis analysis) throws SQLException, TypeMismatchException, StoreException { if (null == analysis) { return null; } @@ -127,7 +127,7 @@ public class DbStore { } - Location getLoc(Long locId) throws SQLException, TypeMismatchException + Location getLoc(Long locId) throws TypeMismatchException, StoreException { if (null == locId) { return null; @@ -137,16 +137,21 @@ public class DbStore { Table[] tables = { CfbSchema.LOCATIONS }; Condition[] conditions = { new Condition(CfbSchema.LOCID, locId, Operation.EQUAL) }; - Row row = m_driver.selectExactlyOne(m_con, columns, tables, conditions); - - String className = row.getString(0); - String methodName = row.getString(1); - String methodRole = row.getString(2); - Integer startLine = row.getInt(3); - Integer endLine = row.getInt(4); - - Location loc = new Location(locId, className, methodName, methodRole, startLine, endLine); - return loc; + try { + Row row = m_driver.selectExactlyOne(m_con, columns, tables, conditions); + + String className = row.getString(0); + String methodName = row.getString(1); + String methodRole = row.getString(2); + Integer startLine = row.getInt(3); + Integer endLine = row.getInt(4); + + Location loc = new Location(locId, className, methodName, methodRole, startLine, endLine); + return loc; + } + catch (SQLException exc) { + throw new StoreException(exc, StoreException.Type.INVALID_LOC_ID, ""+locId); + } } Long getLocId(Location loc) throws SQLException, TypeMismatchException @@ -311,7 +316,7 @@ public class DbStore { return rows.get(0).getLong(0); } - Analysis getAnalysis(Long analysisId) throws SQLException, TypeMismatchException + Analysis getAnalysis(Long analysisId) throws SQLException, TypeMismatchException, StoreException { Column[] columns = { CfbSchema.PROJNAME, CfbSchema.VERSION, CfbSchema.STARTTIME, CfbSchema.ENDTIME }; Table[] tables = { CfbSchema.RUNS }; @@ -339,7 +344,7 @@ public class DbStore { return prior; } - BugCollection getBugCollection(Long runId) throws SQLException, TypeMismatchException + BugCollection getBugCollection(Long runId) throws SQLException, TypeMismatchException, StoreException { Column[] columns = { CfbSchema.FOUNDID,