You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Kevin Xu (JIRA)" <ji...@apache.org> on 2016/01/28 04:19:39 UTC
[jira] [Resolved] (TRAFODION-1780) [MTDCS]jPrepareStatement execute
twice, second ResultSet is empty
[ https://issues.apache.org/jira/browse/TRAFODION-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Xu resolved TRAFODION-1780.
---------------------------------
Resolution: Fixed
> [MTDCS]jPrepareStatement execute twice, second ResultSet is empty
> -----------------------------------------------------------------
>
> Key: TRAFODION-1780
> URL: https://issues.apache.org/jira/browse/TRAFODION-1780
> Project: Apache Trafodion
> Issue Type: Bug
> Components: connectivity-dcs
> Reporter: Kevin Xu
> Assignee: Kevin Xu
>
> //there is 1 row in table t1.
> String query = "SELECT * FROM t1 WHERE id=? AND name=?";
> conn.setAutoCommit(true);
> try {
> PreparedStatement statement = conn.prepareStatement(query);
> statement.setString(1, "1");
> statement.setString(2, "1");
> ResultSet rs = statement.executeQuery();
> assertTrue(rs.next());
> assertFalse(rs.next());
> rs.close();
> // Run another query through same connection and make sure
> // you can't find the new row
> rs = statement.executeQuery();
> assertTrue(rs.next());//Error here
> } finally {
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)