You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Atanu Mishra (JIRA)" <ji...@apache.org> on 2015/08/14 02:42:46 UTC
[jira] [Closed] (TRAFODION-349) LP Bug: 1326458 - JDBC T2 driver
returns error 8813 accessing the ResultSet of an explain statement
[ https://issues.apache.org/jira/browse/TRAFODION-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Atanu Mishra closed TRAFODION-349.
----------------------------------
Resolution: Fixed
Assignee: (was: Pavani Puppala)
Fix Version/s: 1.0 (pre-incubation)
> LP Bug: 1326458 - JDBC T2 driver returns error 8813 accessing the ResultSet of an explain statement
> ---------------------------------------------------------------------------------------------------
>
> Key: TRAFODION-349
> URL: https://issues.apache.org/jira/browse/TRAFODION-349
> Project: Apache Trafodion
> Issue Type: Bug
> Components: client-jdbc-t2
> Reporter: Weishiun Tsai
> Priority: Blocker
> Fix For: 1.0 (pre-incubation)
>
>
> With the JDBC T2 driver, fetching the ResultSet of an explain statement returns the following error:
> *** ERROR[8813] Trying to fetch from a statement that is in the closed state.
> This is similar to another bug report https://bugs.launchpad.net/trafodion/+bug/1274281 'JDBC T2 driver returns error 8813 accessing the ResultSet of a select count(*) statement', except for the statement type. BUG#1274281 has been fixed. The fix for this one will probably be similar to the one for BUG#1274281.
> This is seen on the GIT v0603_0930 build installed on a workstation.
> 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)
> {
> FileInputStream fs = new FileInputStream(new File(propFile));
> props = new Properties();
> props.load(fs);
> url = props.getProperty("url");
> cat = props.getProperty("catalog");
> sch = props.getProperty("schema");
> }
> else
> {
> System.out.println("ERROR: hpjdbc.properties is not set. Exiting.");
> System.exit(0);
> }
> // Class.forName("com.hp.sqlmx.SQLMXDriver");
> Class.forName("org.trafodion.sql.T2Driver");
> 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("explain options 'f' select * from tb");
> rs = conn.createStatement().executeQuery("explain options 'f' select * from tb");
> System.out.println("rs.next()");
> while (rs.next())
> {
> System.out.println("rs.getString(1)");
> System.out.println(rs.getString(1));
> }
> conn.close();
> }
> catch (SQLException se)
> {
> System.out.println("ERROR: SQLException");
> se.printStackTrace();
> System.out.println(se.getMessage());
> System.exit(1);
> }
> catch (Exception e)
> {
> System.out.println("ERROR: Exception");
> e.printStackTrace();
> System.out.println(e.getMessage());
> System.exit(1);
> }
> }
> }
> Here is the execution output of this program:
> -bash-4.1$ myrun.sh
> explain options 'f' select * from tb
> rs.next()
> ERROR: SQLException
> *** ERROR[8813] Trying to fetch from a statement that is in the closed state.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)