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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| > 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 |
| |||
| > 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 |
| ||||
| > > > > 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 |