Subject | RE: [Firebird-Java] Re: Failure on PreparedStatement |
---|---|
Author | Robert DiFalco |
Post date | 2003-04-04T20:42:25Z |
public class ConnectionFactory
{
private static String url = null;
public static Connection createInstance() throws Exception
{
java.util.Properties info = new java.util.Properties();
info.put( "user", ... );
info.put( "charSet", "UTF8" );
if ( url == null )
{
// Class.forName( "interbase.interclient.Driver" );
// url = PropertyExpander.expandString(
"jdbc:interbase://localhost/${tw.home}/data/database/space.fdb" );
Class.forName( "org.firebirdsql.jdbc.FBDriver" );
url = PropertyExpander.expandString(
"jdbc:firebirdsql:localhost/3050:${tw.home}/data/database/space.fdb" );
}
info.put( "password", ... );
Connection con = DriverManager.getConnection( url, info );
con.setAutoCommit( false );
return con;
}
}
-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Friday, April 04, 2003 12:38 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Re: Failure on PreparedStatement
assume, that code in your ConnectionFactory is similar to obtaining a
connection from DriverManager?
Thanks!
Roman
{
private static String url = null;
public static Connection createInstance() throws Exception
{
java.util.Properties info = new java.util.Properties();
info.put( "user", ... );
info.put( "charSet", "UTF8" );
if ( url == null )
{
// Class.forName( "interbase.interclient.Driver" );
// url = PropertyExpander.expandString(
"jdbc:interbase://localhost/${tw.home}/data/database/space.fdb" );
Class.forName( "org.firebirdsql.jdbc.FBDriver" );
url = PropertyExpander.expandString(
"jdbc:firebirdsql:localhost/3050:${tw.home}/data/database/space.fdb" );
}
info.put( "password", ... );
Connection con = DriverManager.getConnection( url, info );
con.setAutoCommit( false );
return con;
}
}
-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Friday, April 04, 2003 12:38 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Re: Failure on PreparedStatement
> Sorry, results are exactly the same with the latest version of theOk, one more question - how do you create your connections? Can I
> driver -- 2/5/2003.
assume, that code in your ConnectionFactory is similar to obtaining a
connection from DriverManager?
Thanks!
Roman