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
293 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 135
backup program with robocopy 6 75
Eclipse Java import and method not resolved 4 82
print bytes of an integer 6 28
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

696 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