Announcement Announcement Module
Collapse
No announcement yet.
output param on simplejdbccall? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • output param on simplejdbccall?

    I have a stored procedure with a single integer output param and 5 varchar input params, no matter what I've tried I can't seem to get the output param back. I've ran the sproc on the db and it comes back with data, so I can't see what I'm doing wrong.

    Does anyone know how to get an output param back from simplejdbccall?

    I have something like this:

    Code:
        SimpleJdbcCall simpleJdbcCall =
            new SimpleJdbcCall( getDatasourceForEnvironment() ).withProcedureName( "_Get_Id" ).declareParameters(
                new SqlParameter( "MyID", Types.VARCHAR ), new SqlParameter( "MySourceID", Types.VARCHAR ),
                new SqlParameter( "MyLocationID", Types.VARCHAR ), new SqlParameter( "MyVisitID", Types.VARCHAR ),
                new SqlParameter( "MyVisitDate", Types.VARCHAR ) );
    
        HashMap< String, String > input = new HashMap< String, String >();
        input.put( "MyID", myObj.getMyID() );
        input.put( "MySourceID", myObj.getMySourceID() );
        input.put( "MyLocationID", myObj.getMyLocationID() );
        input.put( "MyVisitID", myObj.getMyVisitID() );
        input.put( "MyVisitDate", myObj.getMyVisitDate() );
    
        System.out.println( simpleJdbcCall.execute( input ) );

  • #2
    I found that you don't have to do anything, the output data is already in the returned map. I was just connected to the wrong database :|

    Comment

    Working...
    X