This commit is contained in:
Lucio Lelii 2009-09-30 16:50:59 +00:00
parent 4b0fd933e3
commit 72e0ca296a
5 changed files with 15 additions and 5 deletions

View File

@ -222,5 +222,12 @@ public class DBInterface {
st.executeUpdate(query);
st.close();
}
public static void close() throws SQLException{
if (conn!=null){
conn.close();
conn=null;
}
}
}

View File

@ -71,6 +71,7 @@ public class IStoDBUtil {
logger.trace(line);
DBInterface.ExecuteUpdate(line);
}
DBInterface.close();
}catch (Exception e){
logger.error("error creating tables",e);
throw new GCUBEFault(e); }
@ -114,6 +115,7 @@ public class IStoDBUtil {
DBInterface.deleteAll(FunctionalityHandler.portletTableName);
DBInterface.deleteAll(FunctionalityHandler.serviceTableName);
DBInterface.deleteAll(FunctionalityHandler.functionalityTableName);
DBInterface.close();
}catch (SQLException e){
logger.error("error cleaning sqlDB",e);
throw new GCUBEFault(e); }
@ -143,6 +145,7 @@ public class IStoDBUtil {
try{
DBInterface.connect();
DBInterface.insertInto("NEEDEDRESOURCES", values.toArray(new String[0][0]));
DBInterface.close();
}catch (SQLException e){
logger.error("VDLModel: DB error ",e);
throw new GCUBEFault(e);

View File

@ -460,7 +460,7 @@ public class ModelerService {
DBInterface.insertInto("VRERELATEDCS", values.toArray(new String[0][0]));
}
}catch(Exception e){
logger.error("error setting funzionality",e);
logger.error("error setting functionality",e);
throw new GCUBEFault(e);}
}

View File

@ -274,7 +274,7 @@ public class DeployVRE extends Thread{
//retrieving MDCollection with native MDFormat
try{
ResourceItem resItem;
ResultSet resMdColNative =DBInterface.queryDB("select s.mdcollid from SELECTEDNATIVEMDFORMAT AS s where s.vreid='"+this.getParameter().second+"';");
ResultSet resMdColNative =DBInterface.queryDB("select s.mdcollid from VRERELATEDMETADATAFORMAT AS s where s.vreid='"+this.getParameter().second+"';");
while (resMdColNative.next()){
resItem= new ResourceItem();
resItem.setID(resMdColNative.getString(1));
@ -284,7 +284,7 @@ public class DeployVRE extends Thread{
}
}catch(SQLException sqle){
sqle.printStackTrace();
logger.error("Error contacting HSQLDB "+sqle);
logger.error("Error contacting HSQLDB ",sqle);
}
//adding the CollectionResource genericResource

View File

@ -91,7 +91,7 @@ public class FunctionalityHandler implements ResourceHandler<KGCUBEGenericFuncti
psFunctionality.setInt(5, 0);
psFunctionality.execute();
for (Service service: functionality.getServices()){
psServices.setInt(1,rootFunctionalityId);
psServices.setInt(1,id);
psServices.setString(2, service.getServiceName());
psServices.setString(3, service.getServiceClass());
psServices.setString(4, "1.00.00");
@ -99,7 +99,7 @@ public class FunctionalityHandler implements ResourceHandler<KGCUBEGenericFuncti
}
for (String portlet: functionality.getPortlets()){
psPortlets.setInt(1, rootFunctionalityId);
psPortlets.setInt(1, id);
psPortlets.setString(2, portlet);
psPortlets.execute();
}