Is it possible to delete a blog from the "I read these blogs" list?
intervals and jdbc
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > PostgreSQL database development > intervals and jdbc 6 December 2002 06:34:33

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

intervals and jdbc

Joseph Shraibman 6 December 2002 06:34:33
 If I try to get an interval from postgres via jdbc I get:

No class found for interval
at
org.postgresql.jdbc­1.AbstractJdbc1Conne­ction.getObject(Abst­ractJdbc1Connection.­java:693)
at
org.postgresql.jdbc­2.AbstractJdbc2Conne­ction.getObject(Abst­ractJdbc2Connection.­java:117)
at
org.postgresql.jdbc­2.AbstractJdbc2Resul­tSet.getObject(Abstr­actJdbc2ResultSet.ja­va:147)

Why can't the interval just be returned as a String?


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

http://www.postgres­ql.org/users-lounge/­docs/faq.html

Add comment
Dave Cramer 6 December 2002 06:10:50 permanent link ]
 Joseph,

Can you send me a test case to demonstrate what you are trying to do?

Dave
On Thu, 2002-12-05 at 21:45, Joseph Shraibman wrote:> If I try to get an interval from postgres via jdbc I get:>
No class found for interval> at > org.postgresql.jdbc­1.AbstractJdbc1Conne­ction.getObject(Abst­ractJdbc1Connection.­java:693)> at > org.postgresql.jdbc­2.AbstractJdbc2Conne­ction.getObject(Abst­ractJdbc2Connection.­java:117)> at > org.postgresql.jdbc­2.AbstractJdbc2Resul­tSet.getObject(Abstr­actJdbc2ResultSet.ja­va:147)>
Why can't the interval just be returned as a String?>
-------------------­--------(end of broadcast)---------­------------------> TIP 5: Have you checked our extensive FAQ?>
--
Dave Cramer <Dave@micro-automat­ion.net>


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

http://archives.pos­tgresql.org

Add comment
Joseph Shraibman 6 December 2002 06:15:15 permanent link ]
 Try this:
select current_timestamp - '2002-12-05 22:14'::timestamp;

Dave Cramer wrote:> Joseph,>
Can you send me a test case to demonstrate what you are trying to do?>
Dave> On Thu, 2002-12-05 at 21:45, Joseph Shraibman wrote:>
If I try to get an interval from postgres via jdbc I get:>>
No class found for interval>> at >>org.postgresql.jd­bc1.AbstractJdbc1Con­nection.getObject(Ab­stractJdbc1Connectio­n.java:693)>> at >>org.postgresql.jd­bc2.AbstractJdbc2Con­nection.getObject(Ab­stractJdbc2Connectio­n.java:117)>> at >>org.postgresql.jd­bc2.AbstractJdbc2Res­ultSet.getObject(Abs­tractJdbc2ResultSet.­java:147)>>
Why can't the interval just be returned as a String?>>
-----------------­----------(end of broadcast)---------­------------------>>­TIP 5: Have you checked our extensive FAQ?>>


--
Joseph Shraibman
joseph@xtenit.com
Increase signal to noise ratio. http://xis.xtenit.c­om


-------------------­--------(end of broadcast)---------­------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

Add comment
Dave Cramer 6 December 2002 06:24:40 permanent link ]
 Joseph,

What do you want it to return, postgres is assuming you want an
interval, but there is no jdbc interval type. What are you expecting it
to return?

Dave
On Thu, 2002-12-05 at 22:15, Joseph Shraibman wrote:> Try this:> select current_timestamp - '2002-12-05 22:14'::timestamp;>­
Dave Cramer wrote:> > Joseph,> >
Can you send me a test case to demonstrate what you are trying to do?> >
Dave> > On Thu, 2002-12-05 at 21:45, Joseph Shraibman wrote:> >
If I try to get an interval from postgres via jdbc I get:> >>
No class found for interval> >> at > >>org.postgresql.jd­bc1.AbstractJdbc1Con­nection.getObject(Ab­stractJdbc1Connectio­n.java:693)> >> at > >>org.postgresql.jd­bc2.AbstractJdbc2Con­nection.getObject(Ab­stractJdbc2Connectio­n.java:117)> >> at > >>org.postgresql.jd­bc2.AbstractJdbc2Res­ultSet.getObject(Abs­tractJdbc2ResultSet.­java:147)> >>
Why can't the interval just be returned as a String?> >>
-----------------­----------(end of broadcast)---------­------------------> >>TIP 5: Have you checked our extensive FAQ?> >>
--
Dave Cramer <Dave@micro-automat­ion.net>


-------------------­--------(end of broadcast)---------­------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresq­l.org

Add comment
Joseph Shraibman 6 December 2002 06:29:27 permanent link ]
 Dave Cramer wrote:> Joseph,>
What do you want it to return, postgres is assuming you want an> interval, but there is no jdbc interval type. What are you expecting it> to return?>
I was expecting a String. I had to explicity cast it to text to get it to work.


-------------------­--------(end of broadcast)---------­------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresq­l.org

Add comment
Dave Cramer 6 December 2002 06:34:33 permanent link ]
 Really, why a string, I would expect a timestamp, a time, or a date.

ideally this should return a timestamp, as both sides are a timestamp.

Dave
On Thu, 2002-12-05 at 22:29, Joseph Shraibman wrote:> Dave Cramer wrote:> > Joseph,> >
What do you want it to return, postgres is assuming you want an> > interval, but there is no jdbc interval type. What are you expecting it> > to return?> >
I was expecting a String. I had to explicity cast it to text to get it to work.
--
Dave Cramer <Dave@micro-automat­ion.net>


-------------------­--------(end of broadcast)---------­------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHer­e" to majordomo@postgresq­l.org)

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > PostgreSQL database development > intervals and jdbc 6 December 2002 06:34:33

see also:
Pls help me with integration…
php installation help
пройди тесты:
see also:
Free Download - Clone2Go Free Audio…
What is podcasting?
:-D Hey, I've got a pretty lot of...

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .