Hello,
The following piece of code gives two different results when it is run
as embedded
and net client and therefore, I am getting test failures. The results
are as follows:
--------embedded------------
DUMMYINT alias returned 6
DUMMYINT alias returned 22222
-------net client--------------
DUMMYINT alias returned 22222
DUMMYINT alias returned 22222
------expected result-------
DUMMYINT alias returned 6
DUMMYINT alias returned 22222
/**
* test behaviour of meta data and out params after re-compile
*/
public void testMetatdataAfterProcRecompile () throws SQLException {
//System.out.println("Behaviour of meta data and out
params after re-compile");
Statement stmt = createStatement();
CallableStatement cs = prepareCall("CALL dummyint(?,?,?,?)");
cs.registerOutParameter(3,Types.INTEGER);
cs.registerOutParameter(4,Types.INTEGER);
cs.setInt(1,1);
cs.setInt(2,1);
cs.setInt(4,4);
cs.execute();
//System.out.println("DUMMYINT alias returned " + cs.getInt(4));
assertEquals("Unexpected DUMMYINT alias returned",
11111, cs.getInt(4));
stmt.executeUpdate("drop procedure dummyint");
stmt.executeUpdate("create procedure dummyint(in a
integer, in b integer, out c integer, inout d integer) language java
external name
'org.apache.derbyTesting.functionTests.tests.jdbcapi.parameterMetaDataJdbc30.dummyint2'
parameter style java");
cs.execute();
cs.setInt(4, 6);
// following is incorrect sequence, should execute
first, then get
// but leaving it in as an additional negative test.
see beetle 5886
----> System.out.println("DUMMYINT alias returned " + cs.getInt(4));
//assertEquals("Unexpected DUMMYINT alias returned",
6, cs.getInt(4));
cs.execute();
-----> System.out.println("DUMMYINT alias returned " + cs.getInt(4));
//assertEquals("Unexpected DUMMYINT alias returned",
22222, cs.getInt(4));
stmt.executeUpdate("drop procedure dummyint");
cs.close();
}