execute() and executeUpdate() return different SQLState in embedded and network 
client
--------------------------------------------------------------------------------------

                 Key: DERBY-2943
                 URL: https://issues.apache.org/jira/browse/DERBY-2943
             Project: Derby
          Issue Type: Bug
          Components: Network Client
         Environment: Linux Fedora Core 6
            Reporter: Ramin Moazeni


I noticed this issue as part of jdbcapi/statementJdbc30.java conversion to 
JUnit. The following
code snippet returns different SQLState in embedded and network client.

                        //create a table, insert a row, do a select from the 
table,
                        stmt.execute("create table tab1 (i int, s smallint, r 
real)");
                        stmt.executeUpdate("insert into tab1 values(1, 2, 
3.1)");

                        /* Next two stmts will fail because there's no 
auto-generated
                         * column.  These forms of "executeUpdate()" are tested 
more
                         * in the JUnit test, jdbcapi/AutoGenJDBC30Test.java.
                         */

                        System.out.println("trying stmt.executeUpdate(String, 
int[]) :");
                        int[] columnIndexes = new int[2];
                        columnIndexes[0] = 1;
                        columnIndexes[1] = 2;
                        try {
                                stmt.executeUpdate("insert into tab1 values(2, 
3, 4.1)", columnIndexes);
                        } catch (SQLException ex) {
                                BaseJDBCTestCase.assertSQLState("X0X0E", ex);
                        }

                        System.out.println("trying stmt.executeUpdate(String, 
String[]) :");
                        String[] columnNames = new String[2];
                        columnNames[0] = "I";
                        columnNames[1] = "S";
                        try {
                                stmt.executeUpdate("insert into tab1 values(2, 
3, 4.1)", columnNames);
                        } catch (SQLException ex) {
                                BaseJDBCTestCase.assertSQLState("X0X0F", ex);
                        }

Using netwrok client, the returned SQL state is 0A000
Using embedded, the returned SQL state is either X0X0E or X0X0F

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to