Обсуждение: connection variables problem

Поиск
Список
Период
Сортировка

connection variables problem

От
"Badawy, Mohamed"
Дата:

Hi am new to postgresql

Am working using maven framework I want to connect to the DB with no foreign key checking in mysql I use to write (Connection jdbcConnection = DriverManager.getConnection(

                      "jdbc:postgresql://localhost:5432/post?sessionVariables=FOREIGN_KEY_CHECKS=0", "aaa", "aaa");)

I want the corresponding to in postgresql

 

 


THIS EMAIL AND ANY ATTACHED FILES ARE CONFIDENTIAL.

If you are not the intended recipient you are notified that any disclosure, reproduction, copying, distribution, or action taken in reliance on the contents of this information is strictly prohibited. If you have received this transmission in error please notify the sender immediately and then delete this email. Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The company/sender accepts no liability for any changes made to this email during transmission or any damage caused by any virus transmitted by this email. Any views or opinions expressed in this email are solely those of the author and do not necessarily represent those of the company. The company/sender accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing.

AMS Advanced Medical Services GmbH, Mannheim - Registered office: Am Exerzierplatz 2, 68167 Mannheim - Register court: Amtsgericht  Mannheim, HRB 7462  - Managing Director: Dr. Christian Carls

Re: connection variables problem

От
Kris Jurka
Дата:

On Wed, 2 May 2007, Badawy, Mohamed wrote:

> Am working using maven framework I want to connect to the DB with no
> foreign key checking in mysql I use to write (Connection jdbcConnection
> = DriverManager.getConnection(
>
> "jdbc:postgresql://localhost:5432/post?sessionVariables=FOREIGN_KEY_CHEC
> KS=0", "aaa", "aaa");)
>
> I want the corresponding to in postgresql

Postgresql does not offer a similar feature and I see no reason that it
should.  Why would you possibly want to disable your foreign keys?
Perhaps you should be using deferred foreign keys instead?

Kris Jurka


Re: connection variables problem

От
"Badawy, Mohamed"
Дата:
In my case am using dbunit testing. Also I got a selfjoin in a table. So
in deleting the records in that table it fires an exception.

Thnx for ur reply

-----Original Message-----
From: Kris Jurka [mailto:books@ejurka.com]
Sent: Friday, May 04, 2007 7:16 PM
To: Badawy, Mohamed
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] connection variables problem



On Wed, 2 May 2007, Badawy, Mohamed wrote:

> Am working using maven framework I want to connect to the DB with no
> foreign key checking in mysql I use to write (Connection
jdbcConnection
> = DriverManager.getConnection(
>
>
"jdbc:postgresql://localhost:5432/post?sessionVariables=FOREIGN_KEY_CHEC
> KS=0", "aaa", "aaa");)
>
> I want the corresponding to in postgresql

Postgresql does not offer a similar feature and I see no reason that it
should.  Why would you possibly want to disable your foreign keys?
Perhaps you should be using deferred foreign keys instead?

Kris Jurka


THIS EMAIL AND ANY ATTACHED FILES ARE CONFIDENTIAL.
If you are not the intended recipient you are notified that any disclosure, reproduction,copying, distribution, or
actiontaken in reliance on the contents of this information is strictly prohibited. If you have received this
transmissionin error please notify the sender immediately and then delete this email. Email transmission cannot be
guaranteedto be secure or error free as information could be intercepted, corrupted, lost, destroyed,arrive late or
incomplete,or contain viruses. The company/sender accepts no liability for any changes made to this email during
transmissionor any damage caused by any virus transmitted by this email. Any views or opinions expressed in this email
aresolely those of the author and do not necessarily represent those of the company. The company/sender accepts no
liabilityfor the content of this email, or for the consequences of any actions taken on the basis of the information
provided,unless that information is subsequently confirmed in writing. 

------------------------------------------------------------------------------------------
AMS Advanced Medical Services GmbH, Mannheim
Registered office: Am Exerzierplatz 2, 68167 Mannheim
Register court: Amtsgericht Mannheim, HRB 7462
Managing Director: Dr. Christian Carls
------------------------------------------------------------------------------------------