View previous topic :: View next topic |
Author |
Message |
kiwi Captain
Joined: Mar 30, 2004 Posts: 51
|
Posted: Tue Dec 14, 2004 5:31 am Post subject: JDBC connection to postgresql working |
|
Hi,
I have been fighting with JDBC on OOo 1.1.2 for quite some time in my moments of "leisure".
I decided to bite the bullet and try Neo and it works. Haven't done any serious queries / mailing labels just yet. Will try later in the day.
Why is JDBC broken in OOo 1.1.2 OS X??
Cheers
Tony |
|
Back to top |
|
|
ovvldc Captain Naiobi
Joined: Sep 13, 2004 Posts: 2352 Location: Zürich, CH
|
Posted: Tue Dec 14, 2004 11:57 am Post subject: Re: JDBC connection to postgresql working |
|
kiwi wrote: | Hi,
I have been fighting with JDBC on OOo 1.1.2 for quite some time in my moments of "leisure".
I decided to bite the bullet and try Neo and it works. Haven't done any serious queries / mailing labels just yet. Will try later in the day.
Why is JDBC broken in OOo 1.1.2 OS X?? |
I know this is for MySQL, but perhaps this page in the wiki can be of help:
http://sixthcrusade.com/neowiki/index.php?page=EnablemySQL
Oscar |
|
Back to top |
|
|
kiwi Captain
Joined: Mar 30, 2004 Posts: 51
|
Posted: Wed Dec 15, 2004 12:40 am Post subject: |
|
for OOo/X11: you can put it where you want. To let OOo know, you shoud go to "Tools->Options" menu item. Then in the "security" pane, there is a place to add directories to classpath. Click on browse and find your jar file.
This is the method I have always used and it isn't working
Tony |
|
Back to top |
|
|
sardisson Town Crier
Joined: Feb 01, 2004 Posts: 4588
|
Posted: Wed Dec 15, 2004 3:03 am Post subject: |
|
kiwi wrote: | for OOo/X11: you can put it where you want. [...]
This is the method I have always used and it isn't working |
I earlier today updated the wiki with a link to a tutorial I found in the OOo IssueZilla on the Mac-JDBC issue.
From my skimming the doc and limited understanding of the subject (I don't do anything with DB stuff, other than having once generated nametags from a spreadsheet, and copying/pasting the info into the wiki), it tells you to put Connector/J in the OS X java directory and I think OOo finds it.
I guess you had already looked at the wiki before I'd updated it
Smokey |
|
Back to top |
|
|
kiwi Captain
Joined: Mar 30, 2004 Posts: 51
|
Posted: Wed Dec 15, 2004 6:27 am Post subject: |
|
It isn't the database - that accepts connections from the local machine and on the LAN no problem.
It isn't the postgresql.jar - it works with NeoOffice/J and with Tomcat and with...ad nauseum
There is something wrong with OOo 1.1.2 Mac.
Where are the errors written to please?
I had the connection working with the 1.0x as some of you may remember (it wasn't easy then either). Am I still the only poor soul out here that needs a real datbase and not just MySQL on his Mac?
Anyway to stay on topic I have tested with Neo/J. But I can't install this at my clients beacause:
- slow as molasses
- memory runs out (swap gets filled)
- it quits every now and then (normal it is an alpha)
I am running on B&W 400Mhz G3 with 256 Mb RAM - will test on G4 tomorrow
Cheers
Tony |
|
Back to top |
|
|
pluby The Architect
Joined: Jun 16, 2003 Posts: 11949
|
Posted: Thu Dec 16, 2004 11:23 am Post subject: Re: JDBC connection to postgresql working |
|
kiwi wrote: | Why is JDBC broken in OOo 1.1.2 OS X?? |
Because the OOo 1.1.2 had a bug that I fixed in Neo/J. Basically, the OOo releases are called "final" releases even when they haven't really been tested much. Then, when I pull the OOo code into Neo/J and the Neo/J testers start using the code heavily, we find all sorts of bugs in the OOo code and, given enough time, I fix them in Neo/J.
Patrick |
|
Back to top |
|
|
sardisson Town Crier
Joined: Feb 01, 2004 Posts: 4588
|
Posted: Thu Dec 16, 2004 1:12 pm Post subject: Re: JDBC connection to postgresql working |
|
pluby wrote: | kiwi wrote: | Why is JDBC broken in OOo 1.1.2 OS X?? |
Because the OOo 1.1.2 had a bug that I fixed in Neo/J. Basically, the OOo releases are called "final" releases even when they haven't really been tested much. Then, when I pull the OOo code into Neo/J and the Neo/J testers start using the code heavily, we find all sorts of bugs in the OOo code and, given enough time, I fix them in Neo/J. |
Another nice datapoint to remember when people claim Neo/J is not well-tested and is buggier than OOo (the other day, I stumbled--via google--onto another thread where the usual suspects were spreading their FUD about Neo/J again... made me want to scream).
Smokey |
|
Back to top |
|
|
kiwi Captain
Joined: Mar 30, 2004 Posts: 51
|
Posted: Mon Dec 20, 2004 7:49 am Post subject: Re: JDBC connection to postgresql working |
|
pluby wrote: | kiwi wrote: | Why is JDBC broken in OOo 1.1.2 OS X?? |
Because the OOo 1.1.2 had a bug that I fixed in Neo/J. Basically, the OOo releases are called "final" releases even when they haven't really been tested much. Then, when I pull the OOo code into Neo/J and the Neo/J testers start using the code heavily, we find all sorts of bugs in the OOo code and, given enough time, I fix them in Neo/J.
Patrick |
Can I move your JDBC fix to OOo 1.1.2?
Tony |
|
Back to top |
|
|
OPENSTEP The One
Joined: May 25, 2003 Posts: 4752 Location: Santa Barbara, CA
|
Posted: Mon Dec 20, 2004 9:49 am Post subject: |
|
In general, only the person who authors the fixes in NeoJ can move them to OOo. This is because of licensing and copyright issues.
Note that the process of moving over fixes to OOo from NeoJ must be done carefully:
1) Check licensing restrictions. Fixes we make to the GPL code are implicitly GPL licensed, which is incompatible with OOo's licensing. Only the original copyright holder(s) of GPL licensed code can agree to re-release it under a different license. OOo requires code to be licensed under both the SISSL and LGPL licenses. Most OOo fixes we try to contribute back, but even if they're relicensed properly that doesn't always mean they get accepted (see below). You can read my SISSL rants elsewhere in the forums
2) Sign the Joint Copyright Agreement with Sun Microsystems (and make sure you own the copyright to the fixes you want to move too). Sun requires that copyright owners cede copyright to Sun as well for anything that gets moved back into OOo. Note that only the original copyright owner of the code can legally grant joint copyright to another entity.
3) Construct a new issue in the issue tracking system and attach a relevant patch.
4) Wait for someone else within OOo to approve the patch from (3).
5) Get someone to commit your patch if you don't have OOo CVS commit access.
6) Make sure your patch actually got committed to all of the branches.
I've submitted patches in the past that solve Mac OS X issues but have been rejected by the OOo team (e.g. blocked at step 4) and patches that have not gotten merged into new branches (sometimes OS X compile support gets dropped all together on branches!). Honestly, I don't even bother submiting patches any longer since the process is so tedious and political, even for dumb single line bug fixes.
There's a reason why NeoJ is GPL and removes the Sun copyright assignment and politics out of the process of fixing bugs...it's much more efficient
ed |
|
Back to top |
|
|
roberts Agent
Joined: Dec 13, 2004 Posts: 13
|
Posted: Wed Dec 22, 2004 1:09 pm Post subject: help with JDBC and postgresql |
|
I keep getting a "The connection to the data source <DataSource Name> could not be established."
I've checked that the postmaster is listening on the local TCP/IP socket. I put the class in the ../contents/classes folder -- still I can't connect. username and password is correct.
Also, which jdbc driver should I use? The one appropriate to NeoOffice's JVM, or the one that uses the default system JVM?
A few steps on *how* you got postgresql working would be great. Then, we can complain about the speed issues |
|
Back to top |
|
|
roberts Agent
Joined: Dec 13, 2004 Posts: 13
|
Posted: Wed Dec 22, 2004 1:13 pm Post subject: which jdbc driver for postgres? |
|
If I may add to the previous post, the table on the jdbc.postgresql.org website is a bit cryptic. I'm not sure whether apple's built in JVM includes an SDK or if it's just the runtime. In short, I have no idea which driver to download. I'm thinking this may be the problem, as I experience previous errors that said "could not load driver" and then I added the driver to the magic directory and those errors were replaced by "cannot establish connection". |
|
Back to top |
|
|
pluby The Architect
Joined: Jun 16, 2003 Posts: 11949
|
Posted: Wed Dec 22, 2004 1:14 pm Post subject: Re: help with JDBC and postgresql |
|
roberts wrote: | I've checked that the postmaster is listening on the local TCP/IP socket. I put the class in the ../contents/classes folder -- still I can't connect. username and password is correct. |
../contents/classes folder? It should be /Applications/NeoOfficeJ.app/Contents/MacOS/classes
roberts wrote: | Also, which jdbc driver should I use? The one appropriate to NeoOffice's JVM, or the one that uses the default system JVM? |
Neo/J uses Java 1.3.1 so you need to use a JDBC driver that supports that JVM.
Patrick |
|
Back to top |
|
|
roberts Agent
Joined: Dec 13, 2004 Posts: 13
|
Posted: Wed Dec 22, 2004 2:06 pm Post subject: Success (then failure) |
|
The JVM version was the problem. Thanks!
Unfortunately, there are two problems with the JDBC connection:
*It's not possible to create primary keys
*when designing a table, all fields that you create must be exactly 9 (!) characters long -- it doesn't matter if the field is called text, or varchar, or whatever -- it's got to be 9 characters.
While I'm not a database expert, this seems to prevent the use of postgresql with NeoOffice.
Am I doing something wrong, or is JDBC support not yet working properly? I've used other tools that make a jdbc connection to postgresql, such as DB visualizer, and can confirm that the jdbc driver does in fact allow the creation of fields with length other than 9 characters, and that it does let you create primary keys.
Are there any ideas or workarounds?
Thanks,
Robert |
|
Back to top |
|
|
|