On 07-06-2023 19:45, Arioch The wrote:
> Maybe just copying iSQL behavior?
>
> You can open the connection either by "connect" or by "create database",
> period.
>
> Both commands are "constructors", they create a connection object, both
> can not be called on the already constructed connection.
That is not correct. ISQL allows you to create a new database when
currently connected to the database, and as far as I'm aware, this is
done on the existing connection handle, but there is specific
client-side code which triggers specific handling of a CREATE DATABASE
statement.
> Think OOP.
I am thinking OOP, in JDBC you cannot execute statements without
creating a `java.sql.Connection`, from which you create
`java.sql.Statement`, which you can then use to execute something.
My points 1 - 3 and 5 are to be able to execute the statement CREATE
DATABASE through normal JDBC API access, so you need a connection and a
statement before you can execute them.
My point 4 is to create a database when connecting (e.g. if it doesn't
exist yet).
If it was just about creating databases per se, then Jaybird already has
FBManager (and has had that since 2001), but this is about creating
database in a way which is accessible through the JDBC API.
> Databases are members of server, so both connect or create-database
> methods exist in server namespace but not in database namespace.
That is not actually true for Firebird CREATE DATABASE is partially
handled client-side and partially handled server-side.
> Similarly inside "table methods" select-insert-merge-delete you can not
> embed "database methods" like create-view or drop-procedure
>
> Select * from (create view V1 as select..
>
> This makes no sense and want work.
>
> Similarly create-database makes no sense inside database connection but
> only inside server connection
Most other DBMS implementations would disagree with this assertion.
Mark
--
Mark Rotteveel