Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
10.4.1.3
-
None
-
Normal
-
Repro attached
-
Deviation from standard
Description
Running the following program with either embedded or client does not adjust the scale of the output parameter.
public class DecimalOutParam {
public static void main(String[] args) throws Exception
{
//Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
//Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/wombat;create=true");
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:derby:wombat;create=true");
Statement s = conn.createStatement();
try
catch (SQLException se)
{
}
s.executeUpdate("CREATE PROCEDURE DECPROC(OUT DECIMAL(10,2)) parameter style java language java NO SQL external name 'DecimalOutParam.decProc'");
CallableStatement cs = conn.prepareCall("CALL DECPROC");
cs.registerOutParameter(1,java.sql.Types.DECIMAL, 0);
cs.executeUpdate();
System.out.println(cs.getBigDecimal(1));
}
public static void decProc(BigDecimal [] outDec)
{ outDec[0] = new BigDecimal("123.45"); }}
C:/kmarsden/repro/DERBY-2073] java DecimalOutParam
23.45
Should be
23