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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help to convert powershell script into a gui 9 170
SUM 2 INTEGER ARRAYS INTO 1 10 100
C# Error - Add Failed 12 87
sp_configure 'external scripts enabled', 1; 7 50
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

770 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