As it happens I mentioned this problem on ojb-dev the other day, and suggested the default profile should be changed to make it less confusing ...

In profile/postgresql.profile, the default setting

databaseUrl = ${urlProtocol}:${urlSubprotocol}://${databaseHost}/${urlDbalias}

fails for remote databases, since in that case the urlDbalias already looks like e.g. //mycompany.com/OJB.

I suggest it would be clearer to change the defaults to

urlDbalias=//localhost/OJB
databaseUrl = ${urlProtocol}:${urlSubprotocol}:${urlDbalias}

since this should work for local databases and also allows the urlDbalias to be changed in the obvious way for remote ones without altering the databaseUrl setting.

(Note: I've not actually checked the local case however, only the remote one).




Tomas Klubal wrote:
Hello,
please can you help me. I cant connect to PostgreSql (7.2.2) with OJB 0.98.
I have build sources, then I build with jdori ( bin\build with-jdori prepare-tutorials enhance-jdori) and tried junit an tutorials 1 and 5 against mySQL. Everything was OK., then switched to Postgres profile build again with jdori it was ok, db was prepared, tables created, but both tutorials (1 and 5) say cant connect, exactly:

**********************
DBMS:PostgreSQL
DRIVER: org.postgresql.Driver
PROTOCOL: jdbc
SUBPROTOCOL: postgresql
DBALIAS: ojb
USERNAME: postgres
PASSWORD: aaa
EAGER RELEASE: false
pool configuration was: {whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, numTestsPerEvictionRun=10, testWhileIdle=false, testOnReturn=f
alse, timeBetweenEvictionRunsMillis=-1, minEvictableIdleIimeMillis=600000, testOnBorrow=true}
[org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] ERROR: Error getting Connection from DriverManager with url (jdbc:postgresql:ojb) an
d driver (org.postgresql.Driver)
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
*************************
It seems to me that the connection url is not in right format. My config file for postgres looks like this.
Please dont you know, where is the problem?

*****************************
dbmsName = PostgreSQL
jdbcLevel = 1.0
urlProtocol = jdbc
urlSubprotocol = postgresql
urlDbalias = ojb
databaseDriver = org.postgresql.Driver
databaseUser = postgres
databasePassword = aaa
databaseHost = 192.168.1.215

databaseUrl = ${urlProtocol}:${urlSubprotocol}://${databaseHost}/${urlDbalias}
createDatabaseUrl = ${databaseUrl}
buildDatabaseUrl = ${databaseUrl}
*****************************
Thanks.
Tomas Klubal :-)
E-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to