• 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

How to count the updates on the database?

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good day!

I am uploading files on the database? Is there a way that I can count the actual number of files that I have uploaded to the database?

My idea is to count the initial number of rows in the database before uploading, then after uploading, I will count again the number of rows, subtract it with the initial count and then compare the difference with the number of files uploaded. Is this a feasible solution?

One of the things that I am considering is that what if more than one client is uploading the files on the database?



Thanks.
[ November 27, 2007: Message edited by: Darren Alexandria ]
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Darren Alexandria:
Good day!

I am uploading files on the database? Is there a way that I can count the actual number of files that I have uploaded to the database?

My idea is to count the initial number of rows in the database before uploading, then after uploading, I will count again the number of rows, subtract it with the initial count and then compare the difference with the number of files uploaded. Is this a feasible solution?

One of the things that I am considering is that what if more than one client is uploading the files on the database?



Thanks.

[ November 27, 2007: Message edited by: Darren Alexandria ]



if your table has a user and update column on the row... just count the rows associated with your user and update date time.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Darren,

Your solution would only yield reliable information if the following was true:

  • There is only one user updating the database at any given time
  • Each file uploaded results in one and only one row


  • As Paul points out, a more reliable way would be to mark the table with user ID and a date-time stamp.

    Is there a reason that you could not track the number of tables in an instance variable?

    Regards,
    Les
     
    Ranch Hand
    Posts: 862
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Not sure exactly how you are doing this, but if you are using a jdbc connection then the jamon jdbc proxy driver may help.

    The jamon jdbc proxy driver tracks performance stats and how many times each piece of sql has been executed. It also has overall stats for select/insert/update and a few others. No coding is required, simply put jamon-2.7.jar in your classpath and use the jdbc driver to point to the real driver per these instructions:
    http://jamonapi.sourceforge.net/#WhatsNew22

    There is a live demo below. If there is no jdbc data in the report simply go to the main menu's 'generate data' link and generate something to look at.

    Here is a link to use to look at jdbc stats if there is currently data in there
    http://ssouza.kgbinternet.com/jamon/jamonadmin.jsp?sortCol=3&sortOrder=desc&displayTypeValue=BasicColumns&RangeName=AllMonitors&outputTypeValue=html&formatterValue=%23%2C%23%23%23&ArraySQL=-sql&TextSize=0&highlight=
     
    Darren Alexandria
    Ranch Hand
    Posts: 185
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Okay! thanks for your help!

    God bless!
     
    The first person to drink cow's milk. That started off as a dare from this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic