Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stored procedures using JWorks

 
Ian Reddy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need Help, using Stored procedures using JWorks. I am having problems returning values from the stored procedure (single return values, I Could get result sets though).

public Map runStoredProcedure( String callString, Map parameters, String a) throws Exception
{
ItcDatabase db = null;
ItcSqlMgr sqlMgr = null;
ItcDataObject dobjRecord;
Map recordSetMap = new HashMap();

System.out.println("New Function");
try
{
db = getConnection();
sqlMgr = new ItcSqlMgr( db );


// put the list of parameters in an ItcDataObject for processing by the sql mgr.
ItcDataObject dobjParams = null;
if( parameters != null && parameters.size() > 0 )
{
dobjParams = new ItcDataObject();

for( Iterator it=parameters.keySet().iterator(); it.hasNext(); )
{
String paramName = (String) it.next();
dobjParams.put( paramName, parameters.get( paramName ) );
}
}

sqlMgr.exec( "{ ? = call DROP_BATCH_INDEXES_F() }", dobjParams, false );

//I am not sure how to set the return type using Jworks

}
finally
{
if ( sqlMgr != null )
sqlMgr.close();

releaseConnection( db );
}
thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ian ISR",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Ian Reddy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DONE !!
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ian,

I think from reading your post that your specific question is

"I am not sure how to set the return type using Jworks"

I would suspect that JWorks would have a tutorial or documentation that would aid with this. I think their site would be a good place to start. I briefly googled JWorks but I am getting a number of hits and I don't really know what it is that you are using so if you need more help then I would suggest that you post a link to the specific site for the tool that you are using.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic