I have a text file with list of ID, i have to read each ID in it and search in DB for the relevant ID and update a specific column with new value.
Java code to read a text file and update in database
4.3k Views Asked by Keerthisairam At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in MYSQL
- MySQL Select Rank
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Push mysql database script to server using git
- Why does mysql stop using indexes when date ranges are added to the query?
- Google Maps API Re-size
- store numpy array in mysql
- Whats wrong with this query? Using ands
- MySQL-Auto increment
- show duplicate values subquery mysql
- Java Web Application Query Is Not Working
- microsoft odbc driver manager data source name not found and no default driver specified
- Setting foreign key in phpMyAdmin
- No responses from google places text search api
- Adding to MAMP database in SQL/PHP
- I want to remove certain parent- and child-divs in all my wordpress posts with php or some other script
Related Questions in COMMAND-LINE-INTERFACE
- how to run CodeIgniter controller in cli while passing value with $_GET
- Retrieving status from Asterisk using PHP
- Building C# code in VSCode on Mac
- Reading lines from .txt into batch file and handing into command line as arguments?
- C++/CLI/C# Map generic types to template types
- How to fill in a Command Line Interface?
- Doctrine default cli-config.php location
- git CLI commands for stage/unstage hunks/lines like sourcetree
- What is TCL's pattern for translating GUI actions to TCL statements
- how does apache commons-cli parses \\t character
- How to get AWS command line interface to work in cygwin
- CLI to StackExchange Data Explorer
- Laravel Artisan CLI doesn't execute commands
- How to pass a hash as optional argument to -M in command line
- How do I edit a file after I shell to a Docker container?
Related Questions in COMMAND-LINE-TOOL
- How to call getPackageManager() from Android command-line executable
- Android Studio: How to build command-line Android activity with no view (NOT how to build *with* command line)
- Java code to read a text file and update in database
- Signing apk works from Android Studio but why the same keystore do not work on command line?
- Xcode 6.1 Mac OS X new project for command line tool
- Difference between command line tool compiling and IDE compiling Java
- How to codesign an Command line tool application which is included inside another mac osx application
- How to test a simple command line application in Java using JUnit
- unix tools to parse file on the command line
- Commandline Tool giving permission denied due to python path
- Learning Core Audio with Book Sample Code not working
- Android development without gradle and with appcompat or share library
- Installing command line tools Xcode 5
- Create Xcode project from .cpp files
- Command Line Tools Not Available
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I have tried to give you a brief demo of what to do.
Here's the code:
The
LookUpDemoTableclassYou will
applicationContext.xmland put it in the path mentioned in themain()method, that is,resource/spring/applicationContext.xmlYour
applicationContext.xmlshould look like:Your
database.xmlshould have your DB details and the SessionFactory bean defined withLookUpDemoTableclass as itsannotatedClassesYour IdFile should look like:
Hope this helps.
You can also refer to this link :
How to read a txt file in JAVA