Connection con = null;
Statement stmt = null;
// build sql
- StringBuffer sql = new StringBuffer("select ").append(thePKeyName).append(",").append(name).append(" from ").append(theTable);
+ StringBuffer sql = new StringBuffer("select ").append(thePKeyName)
+ .append(",").append(name).append(" from ")
+ .append(theTable);
if (where != null && !(where.length() == 0))
sql.append(" where ").append(where);
sql.append(" order by ");
}
catch (SQLException e)
{
- theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
- + sql);
+ theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime()
+ - startTime) + "ms. for: "+ sql);
throw e;
}
* @return Liefert ResultSet des Statements zurueck.
* @exception StorageObjectException, SQLException
*/
- public ResultSet executeSql (PreparedStatement stmt) throws StorageObjectException,
- SQLException {
+ public ResultSet executeSql (PreparedStatement stmt)
+ throws StorageObjectException, SQLException {
long startTime = (new java.util.Date()).getTime();
ResultSet rs = stmt.executeQuery();
freeConnection(con,stmt);
}
theLog.printInfo(theTable + " has "+ result +" rows where " + where);
- theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+ theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+ + sql);
return result;
}
try
{
rs = stmt.executeUpdate(sql);
- theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+ theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+ + sql);
}
catch (SQLException e)
{
- theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
- + sql);
+ theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime()
+ - startTime) + "ms. for: "+ sql);
throw e;
}
return rs;
throw new StorageObjectException("executeUpdate failed: "+e.toString());
}
finally { freeConnection(con,pstmt); }
- theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+ theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+ + sql);
return result;
}
* @param md ResultSetMetaData
* @exception StorageObjectException
*/
- private void evalMetaData (ResultSetMetaData md) throws StorageObjectException {
+ private void evalMetaData (ResultSetMetaData md)
+ throws StorageObjectException {
+
this.evaluatedMetaData = true;
this.metadataFields = new ArrayList();
this.metadataLabels = new ArrayList();
public Connection getPooledCon() throws StorageObjectException {
- try{
+ /*try{
Class.forName("com.codestudio.sql.PoolMan").newInstance();
} catch (Exception e){
- throw new StorageObjectException("Could not find the PoolMan Driver"+e.toString());
- }
+ throw new StorageObjectException("Could not find the PoolMan Driver"
+ +e.toString());
+ }*/
Connection con = null;
try{
con = SQLManager.getInstance().requestConnection();
* @param wo Funktonsname, in der die SQLException geworfen wurde
* @exception StorageObjectException
*/
- protected void throwSQLException (SQLException sqe, String wo) throws StorageObjectException {
+ protected void throwSQLException (SQLException sqe, String wo)
+ throws StorageObjectException {
String state = "";
String message = "";
int vendor = 0;
sqe.toString());
}
- protected void _throwStorageObjectException (Exception e, String wo) throws StorageObjectException {
+ protected void _throwStorageObjectException (Exception e, String wo)
+ throws StorageObjectException {
if (e != null) {
theLog.printError(e.toString()+ wo);
throw new StorageObjectException(wo + e.toString());
}
/**
- * Loggt Fehlermeldung mit dem Parameter Message und wirft dannach eine StorageObjectException
+ * Loggt Fehlermeldung mit dem Parameter Message und wirft dannach
+ * eine StorageObjectException
* @param message Nachricht mit dem Fehler
* @exception StorageObjectException
*/
- void throwStorageObjectException (String message) throws StorageObjectException {
+ void throwStorageObjectException (String message)
+ throws StorageObjectException {
_throwStorageObjectException(null, message);
}