Updating rows who has same id with different values for each row from java program

Updating rows who has same id with different values for each row from java program

Here is my requirement,

   Following is a table which contains 5 rows with same id.

student table:

 sid   sname  age

  2     aruna  25
  2     balu   30
  2     srinu  40
  2     murali 30
  3     lavanya 35
  1     ashok   27
  1     suresh  24
  1     surya   25
  1     arya    28
  1     sravan  30

Folllowing is my requirement:

If multiple rows have same sid then only we have to update those records.(In this example 4 records are there with sid 2 value and 5 records with sid 1 value.we have to change only those records.) I have to update the records which contains sid 1. But i have to update first row (having sid 1) with "naveen" as value for sname column.And second row(having sid 1) with "varun" as a value for sname column and so on 5th row (having sid 1) with "lalitha" as a value for sname column from java program. Same for records with sid 2 value.

View Answers

Ads









Related Tutorials/Questions & Answers:
Updating rows who has same id with different values for each row from java program
Updating rows who has same id with different values for each row from java...) with "lalitha" as a value for sname column from java program. Same for records with sid... rows with same id. student table: sid sname age 2 aruna 25 2
updating rows which contains same id, different value for each row
updating rows which contains same id, different value for each row  ... 30 From the above table we can identify that 4 rows with sid 1 and 3 rows with sid 5. Like this table may contains multiple records with same sid
Advertisements
how to get values for same column name from two different tables in SQL
how to get values for same column name from two different tables in SQL  how to get values for same column name from two different tables in SQL???? column name is emp_id loacated in these two tables company,employee
Java Program to insert a row in the same sheet of excel file
Java Program to insert a row in the same sheet of excel file  Java program to insert a row in the same sheet of excel file using poi package in java
Arraylist from row values
Arraylist from row values  Hello, can anyone please help on how to make an arraylist from the row values of a particular column from a database...("select * from employee"); ArrayList<String> list=new ArrayList<
Delete a row from database by id
Delete a row from database by id  I m creating a small application... all the values are added in to database and page is redirected to a new page...) for "DELETE" AND "UPDATE". On clicking delete which is hyper link that particular row
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
java program of different shapes
java program of different shapes  pls help me to get the code of a java program of different shapes using menu
Multithreading in Java
Multithreading in java is running multiple threads sharing same address space concurrently. A multithreaded program has two or more parts running simultaneously. Each part is called a thread and has a separate path of execution
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?  How to print different Messge for the same NumberFormatException on different cause objects in JAVA? try { int
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  ... insert there for each row and for each row there is a button "done".if he click on done the values will be inserted into database.Then he enter values for next row
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  ... insert there for each row and for each row there is a button "done".if he click on done the values will be inserted into database.Then he enter values for next row
Java Comparison
Java Comparison       Java Vs Script The Java  and Java Script are completely different from each other although posses same name but don't have
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
or .txt) file and get the values from that file and store them into database table in multiple rows(which means one value for one row). eg: my file containes... row.... can any one help in this program? Regards, P.Divya   hi
different output trying to execute same java code
different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding... there is different output trying to execute same java code
how to run java program that has several classes under package from usb drive?
how to run java program that has several classes under package from usb drive... command line and it works. I copied all java files and class files to flash drive... classes are Circle, Point, PlaneCircle, EHashtable, CHashtable in the same
different output trying to execute same java code
different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding... " portList : false" Why there is different output trying to execute same java
different output trying to execute same java code
different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding... " portList : false" Why there is different output trying to execute same java
Java example program to get the object's ID
Java example program to get the object's ID       java get Object id In java there is no any specific method that provides us the object's ID. But each object has its own unique
Who has the best AI?
Who has the best AI?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Who has the best... the topic "Who has the best AI?". Also tell me which is the good training
delete row using id
= "delete from Insurance insurance where id = 2"; Query query = sess.createQuery...: delete [delete from pkg2.Insurance insurance where id = 2...delete row using id  package pkg2; import org.hibernate.Query; import
JTable duplicate values in row
JTable duplicate values in row  JTable duplicate values in row
how to store array values into two different tables in java?
how to store array values into two different tables in java?  I have use 4/5 textboxes with same name(e.g.text1) and I get the values in a array and now I want to store these values in two different tables(i.e store 2 array
java program for me to see who are on my server
java program for me to see who are on my server  Hello, Im a beginner in java, doing some tutorials and stuff. I wanna write a java program to put on my server where i wanna see if like 3 people are on my server PLUS that i want
Java Vs Script
; The Java  and Java Script are completely different from each other... different in creating an application that they run. Java is a complex object... to prevent from hacking. All this feature of java make it 1000 times better and securable
display the hidden text from that row, when onclick on a row of 1- 10
display the hidden text from that row, when onclick on a row of 1- 10  Using JSP: I'm displaying a set of values from the databse in a table rows (1... of the 10 rows, the hidden text is storing the id for the first row and not any
Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class in different package  Hello everyone; I was going through some design pattern videos on YouTube, however I have a small doubt on some basic Java concept
Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class in different package  Hello everyone; I was going through some design pattern videos on YouTube, however I have a small doubt on some basic Java concept
how to Insert Array Values Into Separate Rows using java?
how to Insert Array Values Into Separate Rows using java?  how to Insert Array Values Into Separate Rows using java?  class InsertArrayValuesInSeparateRow{ public static void main(String[] args
how to create a slider on jsp page n slider has values from 0-4
how to create a slider on jsp page n slider has values from 0-4  i want to create a slider on jsp page and slider has values from 0-4   ...; <div id="slider"></div> </body> </html>

Ads