[ 
https://issues.apache.org/jira/browse/TRAFODION-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14696241#comment-14696241
 ] 

Atanu Mishra commented on TRAFODION-349:
----------------------------------------

Weishiun Tsai (wei-shiun-tsai) wrote on 2014-08-20:     #2
Verified on the 0819_0830 build installed on a workstation. This problem has 
been fixed. Here is the program output:

-bash-4.1$ myrun.sh
explain options 'f' select * from tb
rs.next()
rs.getString(1)

rs.getString(1)
LC RC OP OPERATOR OPT DESCRIPTION CARD
rs.getString(1)
---- ---- ---- -------------------- -------- -------------------- ---------
rs.getString(1)

rs.getString(1)
1 . 2 root 1.00E+002
rs.getString(1)
. . 1 trafodion_scan TB 1.00E+002
-bash-4.1$

Changed in trafodion:
status: Fix Committed → Fix Released


> 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
>            Assignee: Pavani Puppala
>            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)

Reply via email to