Thanks Natalie!
Quick question, if you are using a datasource you probably don't want to
add the connection info to the persistence.xml?
<property name="hibernate.connection.driver_class"
value="org.postgresql.Driver"/>
<property name="hibernate.connection.url"
value="jdbc:postgresql://[database_server_name]:5432/juddi"/>
<property name="hibernate.connection.username" value="juddi"/>
<property name="hibernate.connection.password" value="password"/>
--Kurt
Natalie Turner wrote:
This was written from a jboss - juddi perspective. I realize
non-jboss-users may have to tweak this a little bit, but for the most
part, the files and information needed is here.
Logged in as postgres user, access psql:
# psql
postgres= CREATE USER juddi with PASSWORD 'password';
postgres= CREATE DATABASE juddi;
postgres= GRANT ALL PRIVILEGES ON DATABASE juddi to juddi;
Logged in as user who will access the registry:
Note, for this example, my database is called juddi, as is the user
who has full privileges to the database. The user 'juddi' has a
password set to 'password'.
---------------postgres-ds.xml contents------------------
<datasources>
<local-tx-datasource>
<jndi-name>JuddiDS</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/juddi</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>juddi</user-name>
<password>password</password>
<!-- sql to call when connection is created. Can be anything, select 1
is valid for PostgreSQL
<new-connection-sql>select 1</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained
from pool. Can be anything, select 1 is valid for PostgreSQL
<check-valid-connection-sql>select 1</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
<metadata>
<type-mapping>PostgreSQL 8.0</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
In persistence.xml:
Remove the derby connection properties and add in the postgresql
properties:
<property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.connection.driver_class"
value="org.postgresql.Driver"/>
<property name="hibernate.connection.url"
value="jdbc:postgresql://[database_server_name]:5432/juddi"/>
<property name="hibernate.connection.username" value="juddi"/>
<property name="hibernate.connection.password" value="password"/>
*Be sure to have postgresql-8.3-604.jdbc4.jar in the lib folder! *
Hope this helps. I have three instances of this running right now,
two of them are using two datastores (one DefaultDS and one JuddiDS).
Natalie
On Wed, 2009-06-24 at 11:27 -0400, Kurt T Stam wrote:
We just added documentation on how to switch jUDDIv3 from embedded Derby
to MySQL.
http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/docs/jUDDI-UserGuide.pdf?revision=788050
If you are using another database, we'd love to receive documentation on
the changes you had to make. We'll add it right into this chapter.
Thx,
--Kurt