Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加对获取自增字段值的支持 #15

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -191,4 +192,14 @@ public ResultSet getResultSet() throws SQLException {
public Collection<? extends Statement> getRoutedStatements() throws SQLException {
return cachedRoutedStatements.values();
}

@Override
public ResultSet getGeneratedKeys() throws SQLException {
if (getRoutedStatements().size() > 0) {
return getRoutedStatements().iterator().next().getGeneratedKeys();
}
else {
throw new SQLFeatureNotSupportedException("getGeneratedKeys: not found statement");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ public final void setFetchDirection(final int direction) throws SQLException {
throw new SQLFeatureNotSupportedException("setFetchDirection");
}

@Override
public final ResultSet getGeneratedKeys() throws SQLException {
throw new SQLFeatureNotSupportedException("getGeneratedKeys");
}

@Override
public final void addBatch(final String sql) throws SQLException {
throw new SQLFeatureNotSupportedException("addBatch sql");
Expand Down