类型安全方法中的Oracle定制用户定义类型ReadSql流

时间:2019-04-11 11:45:38

标签: javascript spring-boot jdbc spring-jdbc

嗨,我使用simplejdbccall和storedprocedure进行数据库调用。在我的存储过程中,我的输出中有一些用户定义的类型。我可以在SQLData的帮助下读取此输出类并设置自己的Java对象模型。

我的问题是当我想读取SqlStream时,所有属性在数据库模型中必须相同顺序。是否可以使用类型安全的方法来实现。 当我想更改属性的顺序时想要什么,我想匹配正确的值。 在此解决方案中,当我更改顺序时,所有值都是错误的。

public class MY_INFO implements SQLData, UserDefinedType {
    private int tn_prop1;
    private int tn_prop2;
    private String ts__info;


public String getSQLTypeName() throws SQLException {
    return "xxxx.MY_INFO";
}

public void readSQL(SQLInput sqlInput, String string) throws SQLException {

    setTn_prop1(sqlInput.readInt());
    setTn_prop2(sqlInput.readInt());
    setTs__info(sqlInput.readString());

0 个答案:

没有答案