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

Partially support prepareStatement(String sql, int autoGeneratedKeys) #122

Closed
adiykehler opened this issue Jan 8, 2025 · 0 comments
Closed

Comments

@adiykehler
Copy link

I'm trying to get the DuckDb JDBC driver to run within the Kotlin Exposed framework. It looks like Exposed is using a variant of the DatabaseConnection.prepareStatement method that is not supported by this driver.

// DuckDBConnection.java:297
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
    throw new SQLFeatureNotSupportedException("prepareStatement");
}

However, it appears as if this function is only ever used with autoGeneratedKeys = Statement.NO_GENERATED_KEYS when doing select statements and thus it can be redirected to the prepareStatment(String sql) method, that is already implemented.

public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
    if (autoGeneratedKeys != Statement.RETURN_GENERATED_KEYS) {
        return prepareStatement(sql);
    } else {
        throw new SQLFeatureNotSupportedException("prepareStatement");
    }
}

Something similar is done in the Postgres JDBC driver.

@adiykehler adiykehler closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant