Unix Technical Forum

JAVA_OBJECT: Unkown type

This is a discussion on JAVA_OBJECT: Unkown type within the pgsql Novice forums, part of the PostgreSQL category; --> Hi, i am using java1.5.0 and postgres8.2dev-503 I am trying to store a Java-Object from within a Javaprogramm by ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:08 PM
Julian Hagenauer
 
Posts: n/a
Default JAVA_OBJECT: Unkown type

Hi,
i am using java1.5.0 and postgres8.2dev-503
I am trying to store a Java-Object from within a Javaprogramm by calling 'ps.setObject(2,myObject,java.sql.Types.JAVA_OBJEC T);'

Unfortuntely this results in:
org.postgresql.util.PSQLException: unkown type: 2.000.
at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1680)
at org.postgresql.jdbc3.AbstractJdbc3Statement.setObj ect(AbstractJdbc3Statement.java:1435)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1686)

what is the reason for that? What do i have to do, to get rid of that?

Thank you,
Julian

---------------------------(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
  #2 (permalink)  
Old 04-17-2008, 11:08 PM
Julian Hagenauer
 
Posts: n/a
Default Re: JAVA_OBJECT: Unkown type


> i am using java1.5.0 and postgres8.2dev-503


Sorry, i meant postgres8.2dev-503.jdbc3

Sincerely,
Julian

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 11:08 PM
Michael Swierczek
 
Posts: n/a
Default Re: JAVA_OBJECT: Unkown type

> On 8/27/06, Julian Hagenauer <chaosbringer@gmx.de> wrote:
> Hi,
> i am using java1.5.0 and postgres8.2dev-503
> I am trying to store a Java-Object from within a Javaprogramm by calling 'ps.setObject(2,myObject,java.sql.Types.JAVA_OBJEC T);'
>
> Unfortuntely this results in:
> org.postgresql.util.PSQLException: unkown type: 2.000.
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1680)
> at org.postgresql.jdbc3.AbstractJdbc3Statement.setObj ect(AbstractJdbc3Statement.java:1435)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1686)
>
> what is the reason for that? What do i have to do, to get rid of that?
>
> Thank you,
> Julian
>


> On 8/27/06, Julian Hagenauer <chaosbringer@gmx.de> wrote:
> Hi,
> i am using java1.5.0 and postgres8.2dev-503
> I am trying to store a Java-Object from within a Javaprogramm by calling 'ps.setObject(2,myObject,java.sql.Types.JAVA_OBJEC T);'
>
> Unfortuntely this results in:
> org.postgresql.util.PSQLException: unkown type: 2.000.
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1680)
> at org.postgresql.jdbc3.AbstractJdbc3Statement.setObj ect(AbstractJdbc3Statement.java:1435)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObj ect(AbstractJdbc2Statement.java:1686)
>
> what is the reason for that? What do i have to do, to get rid of that?
>
> Thank you,
> Julian
>


I don't have much to offer. If you download the JDBC driver source from
http://jdbc.postgresql.org/download/...503.src.tar.gz
you may be able to figure out the problem yourself. I only found
references to JAVA_OBJECT in some comments in
org/postgresql/jdbc3/AbstractJdbc3Statement.java
The workhorse function setObject is in
org/postgresql/jdbc2/AbstractJdbc2Statement.java and I don't see an
explicit reference to JAVA_OBJECT in there.

I'm no expert, but if I wanted to save and load Java classes from the
database I would make the class serializable and store and load the
serialized version as a BLOB. Or are you seeking some other
functionality?

-Mike Swierczek

---------------------------(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
  #4 (permalink)  
Old 04-17-2008, 11:08 PM
Julian Hagenauer
 
Posts: n/a
Default Re: JAVA_OBJECT: Unkown type


> >

>
> I don't have much to offer. If you download the JDBC driver source from
> http://jdbc.postgresql.org/download/...503.src.tar.gz
> you may be able to figure out the problem yourself. I only found
> references to JAVA_OBJECT in some comments in
> org/postgresql/jdbc3/AbstractJdbc3Statement.java
> The workhorse function setObject is in
> org/postgresql/jdbc2/AbstractJdbc2Statement.java and I don't see an
> explicit reference to JAVA_OBJECT in there.
>
> I'm no expert, but if I wanted to save and load Java classes from the
> database I would make the class serializable and store and load the
> serialized version as a BLOB. Or are you seeking some other
> functionality?


Hi,
that is exactly how i am doing it rigth now. I though of storing java_objects as a more uper-level implentation, but i can life with serialization too :-)
Thanks,
Julian

---------------------------(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
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 09:20 AM.


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