Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
With the JDBC T2 driver, fetching the ResultSet of a select count statement returns the following error:
-
-
- ERROR[8813] Trying to fetch from a statement that is in the closed state.
-
This is seen using the beta build trafodion-ci-release-trafodion_beta-20140128-v37024_release.tar.
Here is a small JDBC program to reproduce this problem:
-bash-4.1$ cat mytest.java
import java.sql.*;
import java.math.*;
import java.util.*;
import java.io.*;
public class mytest
{
public static void main(String[] args) //throws java.io.IOException
{
Properties props = null;
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
String cat = null;
String sch = null;
String url = null;
String query = null;
try
{
String propFile = System.getProperty("hpjdbc.properties");
if (propFile != null)
else
{ System.out.println("ERROR: hpjdbc.properties is not set. Exiting."); System.exit(0); } Class.forName("com.hp.sqlmx.SQLMXDriver");
conn = DriverManager.getConnection(url, props);
conn.createStatement().execute("drop table if exists tb");
conn.createStatement().execute("create table tb (c1 int not null)");
conn.createStatement().execute("insert into tb values (1),(2),(3),(4),(5),(6),(7),(8),(9)");
System.out.println("select count");
rs = conn.createStatement().executeQuery("select count from tb");
System.out.println("rs.next()");
if (rs.next() != false)
conn.close();
}
catch (SQLException se)
catch (Exception e)
{ System.out.println("ERROR: Exception"); e.printStackTrace(); System.out.println(e.getMessage()); System.exit(1); } }
}
Here is the output of the program:
-bash-4.1$ myrun.sh
select count
rs.next()
ERROR: SQLException
-
-
- ERROR[8813] Trying to fetch from a statement that is in the closed state.
-