Subject | re: With jdbc: how to create a new database (was [Firebird-Java] Digest Number 1134 |
---|---|
Author | A.J. Bonnema |
Post date | 2005-02-10T17:03:47Z |
There were 17 messages in this issue.
Topics in this digest:
<snip>
11. Re: With jdbc: how to create a new database
From: David Jencks <david_jencks@...>
<snap>
13. Re: With jdbc: how to create a new database
From: "rfincher2000" <rnf@...>
<snuf>
________________________________________________________________________
________________________________________________________________________
use one or two directories and I am allowed to create and maintain a
database. I am not allowed to install anything or change any installation.
any database. What I do in Mysql is connect, omitting the databasename
and then issuing the create-database statement.
Why wouldn't jdbc be able to do that for firebird?
it's not as portable as through jdbc.
<snak>
owner through (an institution I am afraid....).
I will send your and Davids message through to them.
Thanks for your advise.
Topics in this digest:
<snip>
11. Re: With jdbc: how to create a new database
From: David Jencks <david_jencks@...>
<snap>
13. Re: With jdbc: how to create a new database
From: "rfincher2000" <rnf@...>
<snuf>
________________________________________________________________________
________________________________________________________________________
> Message: 11Ok, I can see that and I agree. However, the machine is not mine. I can
> Date: Wed, 9 Feb 2005 21:54:35 -0800
> From: David Jencks <david_jencks@...>
> Subject: Re: With jdbc: how to create a new database
>
>
> On Feb 9, 2005, at 7:37 PM, A.J. Bonnema wrote:
>
>>
>> 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.
>
> opening port 3050 to the outside world for firebird is to say the least
> inadvisable.
>
use one or two directories and I am allowed to create and maintain a
database. I am not allowed to install anything or change any installation.
>>Is this particular to firebird? Using Mysql I am able to create and drop
>> 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?
>
> You can't do this through jdbc unless things have greatly changed.
any database. What I do in Mysql is connect, omitting the databasename
and then issuing the create-database statement.
Why wouldn't jdbc be able to do that for firebird?
> However there is a non-jdbc class provided for this kind of thing, IIRCI will see if I can find it. If it works, that's ok with me, even though
> FbManager. Most of the unit tests (used to) use it to create the db
> for the tests. Again, IIRC, firebird won't create directories for you,
> just the final database file.
it's not as portable as through jdbc.
<snak>
> ________________________________________________________________________Are you saying the port is not optional with firebird?
> ________________________________________________________________________
>
> Message: 13
> Date: Thu, 10 Feb 2005 07:06:45 -0000
> From: "rfincher2000" <rnf@...>
> Subject: Re: With jdbc: how to create a new database
>
>
> Hi A.J.,
>
> The format of the URL should be:
>
> jdbc:firebirdsql:[//host[:port]/]<database>
>
> Your example:
>
> jdbc:firebirdsql://hostname/<path-to-new-database>/<new-db-name>
>
> Should be:
>
> jdbc:firebirdsql://hostname:3050/<path-to-new-database>/<new-db-name>
>
> David is right about the security issue. You can either set up aI hear you, loud and clear. It is just not my machine. I will alert the
> secure pipe for port 3050 (using ssh or other solutions), or run a
> simple web app with HTTPS on the database server using a simple app
> server like Tomcat, or a full blown J2EE server.
owner through (an institution I am afraid....).
I will send your and Davids message through to them.
Thanks for your advise.
>Guus.
> With Tomcat, you can set up the sandbox so that you can create the
> local directory too. You could login, fill in the blanks on a web
> page, hit submit, and be done.
>
> An HTTPS solution also has the advantage that most corporate firewalls
> already allow that to pass. Some places won't allow anything to
> penetrate the firewall except HTTP and HTTPS (ports 80 and 443).
>
> That is beyond the scope of this list. But if you contact me off-list
> at rnf@... I can give you a hand with either solution.
>
>
> Rick
>