[jira] [Created] (IGNITE-13000) Connection.prepareStatement(String,int) always throws UnsupportedException ignoring 'autoGeneratedKeys' parameter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-13000) Connection.prepareStatement(String,int) always throws UnsupportedException ignoring 'autoGeneratedKeys' parameter

Anton Vinogradov (Jira)
Pavel Vinokurov created IGNITE-13000:
----------------------------------------

             Summary: Connection.prepareStatement(String,int) always throws UnsupportedException  ignoring  'autoGeneratedKeys' parameter
                 Key: IGNITE-13000
                 URL: https://issues.apache.org/jira/browse/IGNITE-13000
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.8
            Reporter: Pavel Vinokurov


Below the method call throwing Exception.
{code:java}
conn.prepareStatement(query, Statement.NO_GENERATED_KEYS)
{code}

But there is should be the same result as for:
{code:java}
conn.prepareStatement(query)
{code}


The possible fix:
{code:java}
@Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
    ensureNotClosed();
    if(autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS)
        throw new SQLFeatureNotSupportedException("Auto generated keys are not supported.");
    return prepareStatement(sql);
}
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)