This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Stored procedures using JWorks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Stored procedures using JWorks" Watch "Stored procedures using JWorks" New topic
Author

Stored procedures using JWorks

Ian Reddy
Greenhorn

Joined: Mar 23, 2006
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60766
    
  65

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ian Reddy
Greenhorn

Joined: Mar 23, 2006
Posts: 2
DONE !!
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stored procedures using JWorks
 
Similar Threads
How to search String for Map Key
Generic DAO and Generic Stored Procedure in Spring Framework 2.5.6
Strange problem calling oracle function with spring
JBoss - multiple vagueness
apache.commons.FileUpload: parseRequest()-Method changes Request-Object?