Unix Technical Forum

Pb with Spring & Metadat

This is a discussion on Pb with Spring & Metadat within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hello, I want to get database information using metadata with Spring (1.2.4). It's OK with postGre8.0, but when I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:56 PM
TNO
 
Posts: n/a
Default Pb with Spring & Metadat

Hello,

I want to get database information using metadata with Spring (1.2.4).
It's OK with postGre8.0, but when I use postGre8.1, error...

what about this function "information_schema._pg_keypositions()" ?

Caused by: org.springframework.jdbc.support.MetaDataAccessExc eption:
Error while extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
at
org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:180)

at
arc.bd.spring.service.TableService.fillRelation1_1 (TableService.java:181)
... 4 more
Caused by: org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
at
org.postgresql.core.v3.QueryExecutorImpl.receiveEr rorResponse(QueryExecutorImpl.java:1471)

at
org.postgresql.core.v3.QueryExecutorImpl.processRe sults(QueryExecutorImpl.java:1256)

at
org.postgresql.core.v3.QueryExecutorImpl.execute(Q ueryExecutorImpl.java:175)

at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut e(AbstractJdbc2Statement.java:389)

at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut eWithFlags(AbstractJdbc2Statement.java:314)

at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut eQuery(AbstractJdbc2Statement.java:221)

at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData .getImportedExportedKeys(AbstractJdbc2DatabaseMeta Data.java:3237)

at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData .getImportedKeys(AbstractJdbc2DatabaseMetaData.jav a:3533)

at
arc.bd.spring.callback.ImportedKeyInfo.processMeta Data(ImportedKeyInfo.java:28)

at
org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:174)

... 5 more

--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:56 PM
Kris Jurka
 
Posts: n/a
Default Re: Pb with Spring & Metadat



On Thu, 9 Feb 2006, TNO wrote:

> Hello,
>
> I want to get database information using metadata with Spring (1.2.4).
> It's OK with postGre8.0, but when I use postGre8.1, error...
>
> what about this function "information_schema._pg_keypositions()" ?
>
> org.postgresql.util.PSQLException: ERROR: function
> information_schema._pg_keypositions() does not exist
> at


If you're going to use a 8.1 server you need the 8.1 driver as well.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 11:56 PM
tnodev
 
Posts: n/a
Default Re: Pb with Spring & Metadat

I have both postgre8.0 and 8.1 on my station.
8.0 on port 5432 and 8.1 on port 54321

when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !

here's the full trace

arc.bd.service.exception.ArcException:
org.springframework.jdbc.support.MetaDataAccessExc eption: Error while
extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
at
arc.bd.spring.service.TableService.fillRelation1_1 (TableService.java:194)
at arc.bd.spring.service.TableService.fillTable(Table Service.java:107)
at arc.bd.spring.service.TableService.getTablePg(Tabl eService.java:67)
at
arc.bd.spring.service.TestTableService.testTableSe rvice(TestTableService.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
...
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
Caused by: org.springframework.jdbc.support.MetaDataAccessExc eption:
Error while extracting DatabaseMetaData; nested exception is
org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
at
org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:180)
at
arc.bd.spring.service.TableService.fillRelation1_1 (TableService.java:181)
... 18 more
Caused by: org.postgresql.util.PSQLException: ERROR: function
information_schema._pg_keypositions() does not exist
at
org.postgresql.core.v3.QueryExecutorImpl.receiveEr rorResponse(QueryExecutorImpl.java:1471)
at
org.postgresql.core.v3.QueryExecutorImpl.processRe sults(QueryExecutorImpl.java:1256)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(Q ueryExecutorImpl.java:175)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut e(AbstractJdbc2Statement.java:389)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut eWithFlags(AbstractJdbc2Statement.java:314)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execut eQuery(AbstractJdbc2Statement.java:221)
at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData .getImportedExportedKeys(AbstractJdbc2DatabaseMeta Data.java:3237)
at
org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData .getImportedKeys(AbstractJdbc2DatabaseMetaData.jav a:3533)
at
arc.bd.spring.callback.ImportedKeyInfo.processMeta Data(ImportedKeyInfo.java:28)
at
org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:174)
... 19 more




Kris Jurka a écrit :

>
>
> On Thu, 9 Feb 2006, TNO wrote:
>
>> Hello,
>>
>> I want to get database information using metadata with Spring (1.2.4).
>> It's OK with postGre8.0, but when I use postGre8.1, error...
>>
>> what about this function "information_schema._pg_keypositions()" ?
>>
>> org.postgresql.util.PSQLException: ERROR: function
>> information_schema._pg_keypositions() does not exist
>> at

>
>
> If you're going to use a 8.1 server you need the 8.1 driver as well.
>
> Kris Jurka
>
>
>
>



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-15-2008, 11:56 PM
Kris Jurka
 
Posts: n/a
Default Re: Pb with Spring & Metadat



On Fri, 10 Feb 2006, tnodev wrote:

> I have both postgre8.0 and 8.1 on my station.
> 8.0 on port 5432 and 8.1 on port 54321
>
> when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
> when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !
>


You are mistaken about what version of the driver you are using with 8.1.
The stacktrace confirms that you are using an 8.0 driver.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-15-2008, 11:56 PM
TNO
 
Posts: n/a
Default Re: Pb with Spring & Metadat

My Eclipse classpath show me 8.1 driver...

Kris Jurka a écrit :

>
>
> On Fri, 10 Feb 2006, tnodev wrote:
>
>> I have both postgre8.0 and 8.1 on my station.
>> 8.0 on port 5432 and 8.1 on port 54321
>>
>> when I use pg8.0 and driver postgresql-8.0-315.jdbc3.jar, works fine...
>> when I use pg8.1 and driver postgresql-8.1-404.jdbc3.jar error !
>>

>
> You are mistaken about what version of the driver you are using with
> 8.1. The stacktrace confirms that you are using an 8.0 driver.
>
> Kris Jurka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>


--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-15-2008, 11:56 PM
Markus Schaber
 
Posts: n/a
Default Re: Pb with Spring & Metadat

Hi, TNO,

TNO wrote:
> My Eclipse classpath show me 8.1 driver...


Are you shure that you don't have the 8.0 driver deployed into the jdk
ext directory, or somewhere else where it is found by the jdk?

Can you place
System.err.println(org.postgresql.Driver.getVersio n());
into your application to see which driver version it loads?

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-15-2008, 11:56 PM
Kris Jurka
 
Posts: n/a
Default Re: Pb with Spring & Metadat



On Mon, 13 Feb 2006, Markus Schaber wrote:

> TNO wrote:
>> My Eclipse classpath show me 8.1 driver...

>
> System.err.println(org.postgresql.Driver.getVersio n());


or better yet,

System.err.println(org.postgresql.util.PSQLDriverV ersion.main());

This will print out where it has found the driver as well as what version
it has found.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-15-2008, 11:56 PM
TNO
 
Posts: n/a
Default Re: Pb with Spring & Metadat

Seems good... ;-)

PostgreSQL 8.1devel JDBC3 with SSL (build 400)
Found in:
jar:file:/C:/eclipse3.1/Java/Jar/postgresql-8.1dev-400.jdbc3.jar!/org/postgresql/Driver.class



Kris Jurka a écrit :

>
>
> On Mon, 13 Feb 2006, Markus Schaber wrote:
>
>> TNO wrote:
>>
>>> My Eclipse classpath show me 8.1 driver...

>>
>>
>> System.err.println(org.postgresql.Driver.getVersio n());

>
>
> or better yet,
>
> System.err.println(org.postgresql.util.PSQLDriverV ersion.main());
>
> This will print out where it has found the driver as well as what
> version it has found.
>
> Kris Jurka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>


--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-15-2008, 11:56 PM
Kris Jurka
 
Posts: n/a
Default Re: Pb with Spring & Metadat



On Mon, 13 Feb 2006, TNO wrote:

> Seems good... ;-)
>
> PostgreSQL 8.1devel JDBC3 with SSL (build 400)
> Found in:
>


Earlier you claimed to have build 404, but you've only got 400. This
problem was fixed in build 401. Please upgrade.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-15-2008, 11:56 PM
Markus Schaber
 
Posts: n/a
Default Re: Pb with Spring & Metadat

Hi, Kris,

Kris Jurka wrote:

>> TNO wrote:
>>
>>> My Eclipse classpath show me 8.1 driver...

>>
>>
>> System.err.println(org.postgresql.Driver.getVersio n());

>
>
> or better yet,
>
> System.err.println(org.postgresql.util.PSQLDriverV ersion.main());
>
> This will print out where it has found the driver as well as what
> version it has found.


Oh, great tool. However, it does not work this way. You have to call
org.postgresql.util.PSQLDriverVersion.main(args)
with args being a String array, and don't wrap it into
System.err.println, as it returns void.

HTH,
Markus


--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:07 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com