• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC/Java - Read data hourly

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to read data from SQL Server through a Java Progam and I need to read this data hourly (continuously) until there is no more data to grab. I am having a very difficult time learning how to do this... The code currently works. I just don't know how to loop through 'hourly'. In order to get the full date (and time) I needed to identify it as a String when retrieving it from the result set (DateEnd, DateStart, PlacementTime).
Can someone please give me some solid advice with some good examples. Thank you all.


The Code


 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at Quartz Scheduler.
 
Jeremy McNally
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the link. I'm downloading it now and reading a bit about it.

Let me mention though that, when I read this data hourly, I need to go through that hourly batch and pass each record as an argument to another method so a procedure I wrote in Oracle can validate it. Do you have any advice on this?
 
Tim Cooke
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Quartz library takes care of the timing and stuff, and it provides you with a hook so that a method is called at the desired time. From that method you can do whatever you wish. You'll see what I mean once you start learning how to use the library and reading their documentation.
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic