Subject With jdbc: how to create a new database
Author A.J. Bonnema
Hi,

I am new to firebird and I want to create a new file from jdbc.
Currently I am working from a linux box remotely connecting to a windows
box on an unsecured line.

What I want to do is connect to firebird as follows:

Connection con = DriverManager.getConnection(
getUrl(), "userid","password");
Statement stmt = con.createStatement();
stmt.execute("create database " + dbName + ";");

The problem currently is the getUrl(). I have tried returning

"jdbc:firebirdsql://hostname/<path-to-new-database>"
"jdbc:firebirdsql://hostname/<path-to-new-database>/<new-db-name>";
"jdbc:firebirdsql://hostname";

All cases get me an IO error trying to open the file. This makes sense
for the first two cases because the files do not exist yet.
However, for the last case (just the hostname), I expected to be
connected to the server, without being connected to a specific database,
so I could issue a create-database-statement.

Does anyone know how to do this from jdbc?

Guus.

--
A.J. Bonnema, Leiden The Netherlands,
user #328198 (Linux Counter http://counter.li.org)