File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to count the updates on the database?

 
Darren Alexandria
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Paul Campbell
Ranch Hand
Posts: 338
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Les Hayden
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • 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
     
    steve souza
    Ranch Hand
    Posts: 862
    • 0
    • Mark post as helpful
    • send pies
    • 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
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Okay! thanks for your help!

    God bless!
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic