// SqlManager.java import java.util.*; public class SqlManager extends Object implements DbManager { private SqlServer oSqlServer; // CONSTRUCTORS public SqlManager ( String poStringDriverName, String poStringURL, String poStringUsername, String poStringPassword ) { init( poStringDriverName, poStringURL, poStringUsername, poStringPassword); } // PUBLIC METHODS public int dbDelete ( String poStringTable, Object poObject ) { int i = 0; try { i = oSqlServer.sqlUpdate (SqlAssistant.sqlDeleteByExample (poStringTable, (SqlObject)poObject)); } catch (Exception x) { x.printStackTrace(); }; return i; } public int dbInsert ( String poStringTable, Object poObject ) { String oString; int i = 0; try { i = oSqlServer.sqlUpdate (SqlAssistant.sqlInsertByExample (poStringTable, (SqlObject)poObject)); } catch (Exception x) { x.printStackTrace(); }; return i; } public Vector dbSelect ( String poStringTable, Object poObject ) { Vector oVector = new Vector(); String oString; try { oVector = oSqlServer.sqlQuery (SqlAssistant.sqlSelectByExample (poStringTable, (SqlObject)poObject), (SqlObject)poObject); } catch (Exception x) { x.printStackTrace(); }; return oVector; } public int dbUpdate ( String poStringTable, Object poObjectOld, Object poObjectNew ) { SqlObject oSqlObjectNew = (SqlObject)poObjectNew; SqlObject oSqlObjectOld = (SqlObject)poObjectOld; String oString; int i = 0; try { i = oSqlServer.sqlUpdate (SqlAssistant.sqlUpdateByExample (poStringTable, (SqlObject)poObjectOld, (SqlObject)poObjectNew)); } catch (Exception x) { x.printStackTrace(); }; return i; } // PROTECTED METHODS protected void init ( String poStringDriverName, String poStringURL, String poStringUsername, String poStringPassword ) { oSqlServer = new SqlServer( poStringDriverName, poStringURL, poStringUsername, poStringPassword); } }