On 1/30/07, Claas Eggert <[EMAIL PROTECTED]> wrote:
I'm trying to connect to Oracle 10g via ddlutils.
Since my code works fine with DB2 and postgres i'm wondering why i couldn't get
it to work with Oracle using there jdbc driver (ojdbc14.jar or the special
debugging version).
Here's what i tried so far.
The code for postgres:
Class.forName("org.postgresql.Driver").newInstance();
PGSimpleDataSource ds = new PGSimpleDataSource();
ds.setDatabaseName("benchmarking");
ds.setUser("user");
ds.setPassword("user");
platform = PlatformFactory.createNewPlatformInstance(ds);
db = platform.readModelFromDatabase("benchmarking");
For Oracle I already tried some additional options for the DataSource like
setting the DriverType, Port, the DB-URL in various forms (with user and pw,
port etc).
What data source class are you using ? You have to use one that
actually implements the DataSource interface
(http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html).
DdlUtils comes with the commons-dbcp library which contains an
easy-to-use data source class called BasicDataSource
(http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html).
I think the Oracle JDBC driver provides
oracle.jdbc.pool.OracleDataSource also implements of this interface,
but I'm not sure.
Tom