I ran into a situation where our Oracle developer created a new Type that was an array of 4 numbers. I kept getting type conflict SQLExceptions when I set the type as ARRAY. The problem was I needed to use registerOutParameter(int paramIndex, int sqlType, String typeName).
This change affected the following files:
sqlunit.dtd
Param.java
ParamHandler.java
CallHandler.java
sqlunit.dtd
---------------
<!ELEMENT param (#PCDATA)>
<!ATTLIST param
id CDATA #REQUIRED
name CDATA #IMPLIED
type CDATA #REQUIRED
scale CDATA #IMPLIED
typename CDATA #IMPLIED
is-null (true|false) "false"
inout (in|out|inout) "in">
Param.java
----------------
added....
private String typeName;
...
public final void setTypeName(String name) {
this.typeName = name;
}
public final String getTypeName() {
return this.typeName;
}
ParamHandler.java
---------------------------
added in process(Element) ...
param.setTypeName(XMLUtils.getAttributeValue(elParam, "typename"));
Thanks for pointing the bug out and providing a fix for it as well. I will incorporate the fix into CVS and this will be available in the next release.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Its in now, here are the files that were changed and their old and new version numbers:
Checking in docs/sqlunit.dtd;
/cvsroot/sqlunit/sqlunit/docs/sqlunit.dtd,v <-- sqlunit.dtd
new revision: 1.49; previous revision: 1.48
done
Checking in src/net/sourceforge/sqlunit/handlers/CallHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/CallHandler.java,v <-- CallHandler.java
new revision: 1.13; previous revision: 1.12
done
Checking in src/net/sourceforge/sqlunit/handlers/ParamHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/ParamHandler.java,v <-- ParamHandler.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/net/sourceforge/sqlunit/beans/Param.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/beans/Param.java,v <-- Param.java
new revision: 1.6; previous revision: 1.5
done
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I ran into a situation where our Oracle developer created a new Type that was an array of 4 numbers. I kept getting type conflict SQLExceptions when I set the type as ARRAY. The problem was I needed to use registerOutParameter(int paramIndex, int sqlType, String typeName).
This change affected the following files:
sqlunit.dtd
Param.java
ParamHandler.java
CallHandler.java
sqlunit.dtd
---------------
<!ELEMENT param (#PCDATA)>
<!ATTLIST param
id CDATA #REQUIRED
name CDATA #IMPLIED
type CDATA #REQUIRED
scale CDATA #IMPLIED
typename CDATA #IMPLIED
is-null (true|false) "false"
inout (in|out|inout) "in">
Param.java
----------------
added....
private String typeName;
...
public final void setTypeName(String name) {
this.typeName = name;
}
public final String getTypeName() {
return this.typeName;
}
ParamHandler.java
---------------------------
added in process(Element) ...
param.setTypeName(XMLUtils.getAttributeValue(elParam, "typename"));
CallHandler.java
------------------------
param.setTypeName(XMLUtils.getAttributeValue(elParam, "typename"));
...
//start - new code
} else if (params[i].getTypeName() != null){
tcs.registerOutParameter(i + 1, params[i].getSQLType(), params[i].getTypeName());
//end - new code
} else {
tcs.registerOutParameter(i + 1, params[i].getSQLType());
}
HI Greg,
Thanks for pointing the bug out and providing a fix for it as well. I will incorporate the fix into CVS and this will be available in the next release.
-sujit
Its in now, here are the files that were changed and their old and new version numbers:
Checking in docs/sqlunit.dtd;
/cvsroot/sqlunit/sqlunit/docs/sqlunit.dtd,v <-- sqlunit.dtd
new revision: 1.49; previous revision: 1.48
done
Checking in src/net/sourceforge/sqlunit/handlers/CallHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/CallHandler.java,v <-- CallHandler.java
new revision: 1.13; previous revision: 1.12
done
Checking in src/net/sourceforge/sqlunit/handlers/ParamHandler.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/ParamHandler.java,v <-- ParamHandler.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/net/sourceforge/sqlunit/beans/Param.java;
/cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/beans/Param.java,v <-- Param.java
new revision: 1.6; previous revision: 1.5
done
-sujit