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
290 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
4 Comments
 
LVL 6

Accepted Solution

by:
Marv-in earned 125 total points
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now