aspose file tools*
The moose likes JDBC and the fly likes How to count the updates on the database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to count the updates on the database?" Watch "How to count the updates on the database?" New topic
Author

How to count the updates on the database?

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
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

Joined: Oct 06, 2007
Posts: 338
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

Joined: Jun 19, 2002
Posts: 28
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


    Les Hayden
    steve souza
    Ranch Hand

    Joined: Jun 26, 2002
    Posts: 852
    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=


    http://www.jamonapi.com/ - a fast, free open source performance tuning api.
    JavaRanch Performance FAQ
    Darren Alexandria
    Ranch Hand

    Joined: Aug 17, 2007
    Posts: 185
    Okay! thanks for your help!

    God bless!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to count the updates on the database?
     
    Similar Threads
    Initial display of data.
    List of downloaded files has to appear based on the User
    progress bar and timeout functionality for file upload
    HttpClient file upload code review
    How to Upload the Client File To The Server