Solved

How to flag a row of a mysql table which is read through a Java Program? (mySQL+JAVA)

Posted on 2004-10-20
4
295 Views
Last Modified: 2010-04-17
Hello Everybody,

I have a problem with flagging the rows of table(mysql) which were read and which aren't.I will explain my problem.

I am uploading a file by means of a JSP(text file which contains job requirements) to mySQL database table.And i have to read the file from databse by means of another  JAVA program and submit that file to PBS (Job management and execution software).I am able to read the file from database and could submit it to the database.

My problem is i have to read the table row (which contains the file) only once because i have to submit the file to PBS only once.How can i flag the file which one is read (i mean which row of table is read or not).

Suppose 3 different persons submitted files(different file with job requirements) to the database.Let us think previouly there are 5 rows that(files) were submitted to the database.I have to read the last 3 rows which were not submitted to the PBS previously.How can i flag the first 5 rows as they were read and submitted to the databse.

Please reply if somebody have some idea.

Thanks for your time and patience,
Rams.
0
Comment
Question by:ramsin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Accepted Solution

by:
Marv-in earned 125 total points
ID: 12356755
i usually use a status field in my database - 0 by default so all new records will be 0

-then once you grab your status 0 records in your recordset
-create a string sql query on they fly so all the unique ids of the records will be in the where clause
-process your data
-update the records to a 1

0
 
LVL 1

Assisted Solution

by:crulx
crulx earned 125 total points
ID: 12360598
You need to answer a few questions first to get a proper response.

Firstly, are you allowed to query the database you have submitted the files to? If so, and the files have a unique name or a unique key assigned outside of the database then you can search the database to see if your files have been submitted. If not, you will need to modify the original file or have a database yourself to record this information.

Do the files have unique names or an externally assigned ID? If they do, then you can easily make database queries or locally store the submitted information. If not, then you must create a unique key for the job files by either an MD5 hash of the file, combining the name and the date, or some other unique way of referring to that particular file.

Let me know a bit more about your situation to get further help.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question