Hi Ned, I saw your name all over the pgsql-jdbc mailing list, I wondered if you would be the guy to respond :)
Using PostgreSQL 7.1.2 in Cygwin 1.3.2, I'm also using the jdbc driver that comes with 7.1.2 I ripped the port number out of my JDBC url and got everything running. Although 5432 clearly looks like a bogus port, I saw it in all the PostgreSQL and Castor docs, so I took it on faith that it worked -- it doesn't. The castor docs should be updated to remove this unneeded port from the examples. Had that been the case, I never would have had the problem. Anyway, new problem now. Of course now that I have it running, I immediately notice I need to setup a keygenerator for handling a PostgreSQL sequence. You don't happen to have a few example handy do you? Thanks! David > -----Original Message----- > From: Ned Wolpert [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 07, 2002 10:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] Castor and PostgreSQL > > > David- > > I've not seen the specific problem you are having. What version of > postgresql are you using, and what 'version' of the postgresql driver? > I use 7.2, with the driver in that release. (Though the driver in the > Castor repository should work too.) When I use the postgresql data > source, I configure it like this: (for my local postgres installation, > with the database name 'mediamgmt') > > <database name="mediamgmt" engine="postgresql"> > <data-source class-name="org.postgresql.PostgresqlDataSource"> > <params database-name="mediamgmt" user="user" > password="password" server-name="localhost"/> > </data-source> > ... > > and as a driver, this way: > > <database name="knowledgenet" engine="postgresql"> > <driver class-name="org.postgresql.Driver" > url="jdbc:postgresql://localhost/mediamgmt"> > <param name="user" value="user"/> > <param name="password" value="password"/> > </driver> > ... > > > > On Thu, 2002-03-07 at 09:08, David Blevins wrote: > > Hi all, > > > > I trying to use Castor against PostgreSQL and having no luck. > With a config > > like this: > > > > <database name="Local_TX_Database" engine="postgresql" > > > <driver class-name="org.postgresql.Driver" > > url="jdbc:postgresql://127.0.0.1:5432/openejbtest"> > > <param name="user" value="openejbuser" /> > > <param name="password" value="javaone" /> > > </driver> > > > > ...I get this exception: > > > > org.exolab.castor.jdo.PersistenceException: Nested error: > > java.sql.SQLException: ERROR: entity: Permission denied. > > > > This is strange, because if I use that same information against > PostgreSQL's > > JDBC driver directly, it works just fine. > > > > try{ > > Class.forName("org.postgresql.Driver"); > > Connection conn = > > DriverManager.getConnection("jdbc:postgresql://127.0.0.1/openejbtest", > > "openejbuser","javaone"); > > Statement stmt = conn.createStatement(); > > } catch (Exception e){ > > e.printStackTrace(); > > } > > > > I tried using the other way of configuring Castor for > PostgreSQL as shown at > > the website (which has a typo in it BTW, the 's' is missing > from 'params' in > > the first PosgreSQL example). > > > > <database name="Local_TX_Database" engine="postgresql" > > > <data-source class-name="org.postgresql.PostgresqlDataSource"> > > <param server-name="127.0.0.1" port-number="5432" > > database-name="openejbtest" > > user="openejbuser" password="javaone" /> > > </data-source> > > > > This gives me the infamous NullPointerException at > > org.postgresql.Connection.openConnection(Connection.java:148). I am > > familiar with this error as I ran across it in my previous > tests with just > > JDBC and PostgreSQL alone, it turned out that I had left the > database name > > out of my JDBC URL as in: > > > > > DriverManager.getConnection("jdbc:postgresql://127.0.0.1/","openej > buser","ja > > vaone"); > > When I caught the mistake and added the database name to the > end of the URL, > > everything worked fine. Maybe Castor is having the same trouble? > > > > Anyway, none of my Castor/PostgreSQL attempts seem to work. Any ideas? > > > > Thanks, > > David > > > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-dev > -- > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
