English 中文(简体)
产出段
原标题:output param on simplejdbccall

我有一个储存程序,有一个单一的分类输出段和5个变体输入参数,不管我所尝试的是什么,我似乎无法收回产出。 我先拿 d子,然后拿数据回来,因此,我可以看一看我做的错误。

是否有任何人知道如何从简单的jdbcert中恢复产出?

我有这样的情况:

    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 ) );
问题回答

我有两点错误:

  1. I was connected to the wrong database. Writing a more granular unit test revealed my error.

  2. Since the return from "execute" is a map, the output params are case sensitive.

简言之,你需要做的事情不多——春天包括产出部分,否则。 此外,是采用这些方法的更清洁的方法。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签