Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < | Sun's reference j2ee server (j2sdk1.2.1) will work with Postgresql, although it's not a supported configuration and therefore probably not a great idea for production systems. I like the combination, though, since my machines are resource constrained and I'm usually running Postgresql anyway - I'd rather not have another JVM running to handle database queries. | |||||||
> > | Sun's reference j2ee server (j2sdk1.2.1 and j2sdk1.3) will work with Postgresql, although it's not a supported configuration and therefore probably not a great idea for production systems. I like the combination, though, since my machines are resource constrained and I'm usually running Postgresql anyway - I'd rather not have another JVM running to handle database queries. | |||||||
The steps to follow are:
| ||||||||
Line: 23 to 23 | ||||||||
First find the postgresql.jar file (it's in /usr/share/java on my Debian box) and copy it to $J2EE_HOME/lib/system (according to the j2ee docs it needs to be there for security reasons). Then edit $J2EE_HOME/bin/userconfig.sh so that =$J2EE_CLASSPATH includes postgresql.jar. | ||||||||
Added: | ||||||||
> > | 1.2.1: | |||||||
Edit $J2EE_HOME/config/default.properties . First look for the line that looks like:
jdbc.drivers=COM.cloudscape.core.RmiJdbcDriver | ||||||||
Line: 37 to 39 | ||||||||
I suppose this is somewhat misleading but it requires the fewest changes from the Cloudscape configuration. | ||||||||
Added: | ||||||||
> > | 1.3:
Edit $J2EE_HOME/config/resource.properties . Add a line:
jdbcDriver.1.name=org.postgresql.Driver
and then change
jdbcDataSource.0.url=jdbc:cloudscape:rmi:CloudscapeDB;create=true
to
jdbcDataSource.0.url=jdbc:postgresql:account | |||||||
Change the user ID in the beans | ||||||||
Deleted: | ||||||||
< < | l | |||||||
The Cloudscape server doesn't seem to use the jdbc user/password that postgresql does so you'll need to add it to your beans. In the deploytool you choose the bean (say "AccountBean") in the left pane then choose the "Resource Ref's" tab at the top of the right pane. Select the resource factory whose name is "jdbc/AccountDB" and you'll see that the "Deployment Settings" box at the bottom will now allow you to enter a JNDI name (which has to match the one in the jdbc.datasources , e.g. jdbc/Cloudscape , and a username and password. You can now save and deploy the application. (As an aside: if you're building the .ear by hand you'll need to put these values in the META-INF/sun-j2ee-ri.xml file).
Go for it! | ||||||||
Line: 46 to 62 | ||||||||
Run the AccountClient client and bask in the glory that is postgresql and java. A few troubleshooting notes:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|