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
Support executing CREATE DATABASE statements [JDBC598] #629
Comments
Modified by: @mrotteveeldescription: In all existing versions of Jaybird it is not possible to execute CREATE DATABASE using a JDBC statement. This will yield a "java.sql.SQLSyntaxErrorException: Dynamic SQL Error; SQL error code = -530; Cannot prepare a CREATE DATABASE/SCHEMA statement [SQLState:42000, ISC error code:335544597]". However dropping to the low-level API to try and use executeImmediate will simply do nothing. And connecting but not attach allows to create a database using a native connection, but not using a pure-java connection. We need to investigate whether it is possible to execute CREATE DATABASE when attached to a database, and if so: how. => In all existing versions of Jaybird it is not possible to execute CREATE DATABASE using a JDBC statement. This will yield a "java.sql.SQLSyntaxErrorException: Dynamic SQL Error; SQL error code = -530; Cannot prepare a CREATE DATABASE/SCHEMA statement [SQLState:42000, ISC error code:335544597]". However dropping to the low-level API to try and use executeImmediate will simply do nothing. And connecting but not attach allows to create a database using a native connection, but not using a pure-java connection. We need to investigate whether it is possible to execute CREATE DATABASE when attached to a database, and if so: how. See also #27 |
The appropriate approach would seem to be to parse the create statement client side, populate the appropriate DPB items (maybe inheriting some from the current connection) and then creating a new connection and using |
We have IUtil::executeCreateDatabase which does >90% of described actions |
Jaybird is - by default - a pure Java driver, so I don't want to call functions from fbclient. It might be helpful for reference though. |
Perhaps the best way to support database creation would be an option in the connection url as is the case for many JDBC drivers. |
@prrvchr Could you also add your opinion to this thread on firebird-java: https://groups.google.com/g/firebird-java/c/N1PHCM8TnPk ? |
Submitted by: @mrotteveel
In all existing versions of Jaybird it is not possible to execute CREATE DATABASE using a JDBC statement. This will yield a "java.sql.SQLSyntaxErrorException: Dynamic SQL Error; SQL error code = -530; Cannot prepare a CREATE DATABASE/SCHEMA statement [SQLState:42000, ISC error code:335544597]". However dropping to the low-level API to try and use executeImmediate will simply do nothing. And connecting but not attach allows to create a database using a native connection, but not using a pure-java connection.
We need to investigate whether it is possible to execute CREATE DATABASE when attached to a database, and if so: how.
See also #27
The text was updated successfully, but these errors were encountered: