Results 1 to 4 of 4
  1. #1
    couling is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default Looking for PostgreSQL libraries - Type 2 JDBC or JNI

    Hi

    I'm looking for a way to write a java program which can access a PostgreSQL databse. The catch is the database only has unix domain sockets. I'm specifically avoiding opening up TCP sockets as that will cause a lot of complication with authentication.

    Before I dive into JNI myself, is anyone aware of an existing PostgreSQL driver for java (JDBC or otherwise) which uses JNI. Eg: a type 2 JDBC driver.

    Regards
    ----Signature ----
    Please use [CODE] tags and indent correctly. It really helps when reading your code.

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    952
    Rep Power
    5

    Default

    What version of PostgreSQL are you using? Version 8 runs by default on TCP localhost as well as Unix domain sockets, with the same ident authentication. Seems to me it'd be far fewer headaches dealing with the Unix admin issues than writing and supporting a JNI driver. And it seems from a little casual browsing on the issue that the rest of the PostgreSQL Java world has come to that same conclusion. :)

    -Gary-

  3. #3
    couling is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default

    Yes where the server is configured to use both, Type 4 JDBC driver is the more simple solution. However in this case I'm looking to access a server which is configured to only use Unix-Domain sockets. ;)
    ----Signature ----
    Please use [CODE] tags and indent correctly. It really helps when reading your code.

  4. #4
    couling is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default

    I've been doing a lot more reading. I seems I may be able to get TCP 127.0.0.1 to operate like a Unix socket if i install an ident server.

    I'm going to have to considder if this opens any security holes up though.
    ----Signature ----
    Please use [CODE] tags and indent correctly. It really helps when reading your code.

Similar Threads

  1. help with jdbc for postgresql
    By arano86 in forum New To Java
    Replies: 2
    Last Post: 09-14-2009, 01:27 PM
  2. Error connecting to postgresql
    By murphyjirus in forum Advanced Java
    Replies: 6
    Last Post: 10-31-2008, 10:52 AM
  3. PostgreSQL driver
    By bugger in forum JDBC
    Replies: 3
    Last Post: 01-11-2008, 10:45 AM
  4. Replies: 1
    Last Post: 08-08-2007, 03:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •