Configuring Hibernate for PostgreSQL Access Over Unix Socket WithJDBC

Поиск
Список
Период
Сортировка
От Dan
Тема Configuring Hibernate for PostgreSQL Access Over Unix Socket WithJDBC
Дата
Msg-id adab8102-6e97-e2b8-c7fd-2c741b8135f5@scapps.co.uk
обсуждение исходный текст
Ответы Re: Configuring Hibernate for PostgreSQL Access Over Unix Socket With JDBC  (Sehrope Sarkuni <sehrope@jackdb.com>)
Список pgsql-jdbc

Hello,

I hope it is appropriate to send this question to this address.  If not, kindly redirect me.

I am trying to configure Hibernate to use a Unix socket connection to my local PostgreSQL installation.  I have referred to this doc:
https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters

and have been trying entries in hibernate.cfg.xml along these lines:

<property name="hibernate.connection.url">jdbc:postgresql:kokodoko?socketFactory=org.newsclub.net.unix.socketfactory.PostgresqlAFUNIXSocketFactory&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432</property>

The XML validator in Eclipse is flagging this error:

    The reference to entity "socketFactoryArg" must end with the ';' delimiter.


(Of course I have tried many variations such as inserting semicolons in various places, quoting the argument, using square brackets and so on.)

If I ignore the error and try to use config file I get this error:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "backendError",
    "message": "org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in RESOURCE hibernate.cfg.xml. Message: null"
   }
  ],
  "code": 503,
  "message": "org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in RESOURCE hibernate.cfg.xml. Message: null"
 }
}

which I take to mean that the config file is unusable.

Is what I am trying to do (Hibernate, JDBC, PostgreSQL, hibernate.cfg.xml, Unix socket) possible?  If so, kindly give me some guidance.  If not, can you suggest a different approach that uses a Unix socket?

I am posting a similar request on the Hibernate forum.

Thanks very much.

-Dan


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: [pgjdbc/pgjdbc]
Следующее
От: Sehrope Sarkuni
Дата:
Сообщение: Re: Configuring Hibernate for PostgreSQL Access Over Unix Socket With JDBC