mtserver - spjs with resultsets failing - no results returned
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
New
|
High
|
Unassigned |
Bug Description
SPJ tests with result sets failed because there are no result sets returned from the procedure. the same SPJ works from sqlci, but fails from trafci.
Steps:
---------
SQL>create table t1 (a int not null primary key, b varchar(20));
SQL>insert into t1 values(111, 'aaaaa');
SQL>insert into t1 values(222, 'bbbbb');
SQL>create library testrs file '/opt/home/
SQL>create procedure RS200()
language java
parameter style java
external name 'Testrs.RS200'
dynamic result sets 1
library testrs;
SQL>call rs200();
--- SQL operation complete.
---------
The expected result is:
SQL >call rs200();
A B
----------- -------
111 aaaaa
222 bbbbb
--- 2 row(s) selected.
--- SQL operation complete.
The jar file, testrs.jar, is on amber7 under /opt/home/
public static void RS200(ResultSet[] paramArrayOfRes
throws Exception
{
String str1 = "jdbc:default:
String str2 = "select * from t1";
Connection localConnection = DriverManager.
Statement localStatement = localConnection
paramArray
}
Changed in trafodion: | |
assignee: | nobody → Zbigniew Omanski (zbigniew-omanski) |
tags: |
added: client-jdbc-t2 removed: connectivity-dcs |
SPJ with Result Set doesn't work with T2 Driver.
1. Created SPJ that calls T2 Driver
import java.io.*;
import java.sql.*;
import java.math.*;
import java.util.*;
public class ZProcs java.sql. ResultSet[ ] columns, java.sql. ResultSet[ ] select)
{
public static void ZN0220(
{
Connection conn = null;
Statement stmt = null;
Properties props = null;
String url = null;
String usr = null;
String pwd = null;
String catalog = null;
String schema = null;
String hpjdbc_version = null;
try { zomanski/ spj/t2prop" ;
FileInputStream fs = new FileInputStream(new File(propFile));
props.load( fs);
String propFile = "/opt/home/
if (propFile != null) {
props = new Properties();
url = props.getProper ty("url" );
catalog = props.getProper ty("catalog" );
schema = props.getProper ty("schema" );
} else {
System. out.println( "ERROR: hpt2jdbc.properties is not set. Exiting.");
System. exit(0) ;
Properties myProp = new Properties();
myProp. put("catalog" , catalog);
myProp. put("schema" , schema);
}
conn = DriverManager.
stmt = conn.createStat
select[0] = ps2.executeQuery();
}
catch (Exception e) {
}
}
public static void main(String[] paramArrayOfString)
{
}
}
2. t2prop
catalog=TRAFODION version= org.trafodion. jdbc.t2. T2Driver
schema=T2QA
url=jdbc:t2jdbc:
hpjdbc_
usr=sqluser_admin
pwd=redhat06
batchBinding=500
3. When executed from SQL got correct output: zomanski/ spj/lib/ zcall.jar' ;
>>create library spjzcall file '/opt/home/
--- SQL operation complete.
>>Create procedure ZN0220 () external name 'ZProcs.ZN0220' library spjzcall language java parameter style java DYNAMIC RESULT SETS 2;
--- SQL operation complete.
>>call ZN0220();
C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 ------- ------ ------ ----------- ------- ------- ------ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- - ------- ------- ------- ------------ ---------- -------- ------- ------- ------- ----- ------- ------- ------- ---- ------- ------- ------- ----
-------
Moe 100 12345678 123456789012 Moe 100.12 100.12...