You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/12 10:20:01 UTC

[jira] [Commented] (TRAFODION-2686) use setCursorName(String name) of Statement to set Cursor Name fail

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

ASF GitHub Bot commented on TRAFODION-2686:
-------------------------------------------

GitHub user luoyunpeng opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1175

    TRAFODION-2686 fix setCurSorName does not work

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/luoyunpeng/incubator-trafodion setcursorname-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1175.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1175
    
----
commit a20d74fb8ed21828a96c673ff978fc3c15b3bd17
Author: luoyunpeng <95...@qq.com>
Date:   2017-07-12T10:08:35Z

    TRAFODION-2686 fix setCurSorName does not work

----


> use setCursorName(String name) of Statement to set Cursor Name fail
> -------------------------------------------------------------------
>
>                 Key: TRAFODION-2686
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2686
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-jdbc-t4
>            Reporter: 王宏伟
>
> {color:#59afe1}use setCursorName(String name) of Statement to set Cursor Name fail:{color}
> stmt.setCursorName("rsCursor");
> {color:#d04437}*assertEquals("rsCursor", rs.getCursorName());*
> expected:*rsCursor*,but was:*SQL_CUR_5*{color}
> {color:#59afe1}test code as following:{color}
> public class TestSetCursorName {
>     public static String driver = "xxxx";
>     public static String url = "xxx";
>     public static String user = "xx";
>     public static String password = "xx";
>     public static Connection conn = null;
>     protected ResultSet rs = null;
>     public static Statement stmt = null;
>     private String select_dml = null;
>      private String create_ddl = "";
>     private String insert_dml = "";
>     
>     @Test
>     public void testSetCursorName() throws SQLException{
>         String tableName = "testsetCursorName";
>         String schema = "testsSchema";
>         try {
>             Class.forName(driver);
>             conn = DriverManager.getConnection(url, user, password);
>             stmt = conn.createStatement();
>             
>             create_ddl = "create table " + schema + "." + tableName 
>                     + "(" + "c_char char(30),"+ "c_integer integer" + ")";
>             stmt.execute(create_ddl);
>             insert_dml = "insert into " + schema + "." + tableName +""
>                     + " values(" + "'test char'," + 123 + ")";
>             stmt.executeUpdate(insert_dml);
>             select_dml = "select * from " + schema + "." + tableName;
>             stmt.execute(select_dml);
>             rs = stmt.getResultSet();
>             assertNotNull(rs.getCursorName());
>             stmt.setCursorName("rsCursor");
>             {color:#d04437}assertEquals("rsCursor", rs.getCursorName());{color}
>         } catch (ClassNotFoundException e) {
>             e.printStackTrace();
>         } catch (SQLException e) {
>             e.printStackTrace();
>         }
>         finally {
>             stmt.execute("drop table " + schema + "." + tableName );
>             stmt.close();
>             conn.close();
>         }
>     }
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)