public void initRepository() throws IOException { initDB(); try { insertStmt = conn.prepareStatement("INSERT INTO JoramDB VALUES (?, ?)"); updateStmt = conn.prepareStatement("UPDATE JoramDB SET content=? WHERE name=?"); deleteStmt = conn.prepareStatement("DELETE FROM JoramDB WHERE name=?"); } catch (SQLException sqle) { sqle.printStackTrace(); throw new IOException(sqle.getMessage()); } }
public void initRepository() throws IOException { dbtable = AgentServer.getProperty(TABLE_NAME_PROP, DFLT_TABLE_PREFIX + AgentServer.getServerId()); initDB(); try { insertStmt = conn.prepareStatement("INSERT INTO " + dbtable + " VALUES (?, ?)"); updateStmt = conn.prepareStatement("UPDATE " + dbtable + " SET content=? WHERE name=?"); deleteStmt = conn.prepareStatement("DELETE FROM " + dbtable + " WHERE name=?"); } catch (SQLException sqle) { sqle.printStackTrace(); throw new IOException(sqle.getMessage()); } }