Solved

how to check if the record exists in the table

Posted on 2016-07-14
2
26 Views
Last Modified: 2016-08-28
I'm using jdbctemplate.update to insert a record in the database.

public void write(List<? extends Person> persons) throws Exception {
            LOGGER.debug("Entering<---");
            personList.addAll((Collection<? extends Person>) persons.get(0));
            for(Person person:personList) {
                  jdbcTemplate.update(INSERT_PERSON_INFO, new Object[] {Integer.parseInt(person.getID()),person.getPassword(),person.getUserName());}
            LOGGER.debug("Exit  --->");
      }


So I want to modify the code to not allow any duplicate entry into the database and instead update the existing record.

Any help would be appreciated?
0
Comment
Question by:Newton21205
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 41711550
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 40
myqsl update statement on phpMyAdmin 8 21
javap not working 8 36
Opening PDF on button click and fill new document 2 16
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

910 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

21 Experts available now in Live!

Get 1:1 Help Now