how to insert array data into sql server using jsp
hello,
i have problem to insert array data into my sql server from jsp form. beloW is my code .
From system.out.prinln, it show 1 record only in printed what i'm already keyin from form, but not insert into my sql database.
try {
//String s1 [] = request.getParameterValues("id");
String s2 [] = request.getParameterValues("idAttand");
String s3 [] = request.getParameterValues("noKP");
String s4 [] = request.getParameterValues("tarikhAtt");
String s5 []= request.getParameterValues("timeIn");
String s6 [] = request.getParameterValues("timeOut");
String s7 []= request.getParameterValues("notes");
String s8 [] = request.getParameterValues("status");
for(int j= 0; j<s4.length; j++)
{
System.out.println( "| "+s2[j]+"|"+ s3[j] + "|"+s4[j]+"|"+s5[j] + "|"+s6[j]+"|"+ s7[j] + "|"+s8[j]);
String sql = "insert into tblAttand(idAttand,noKP,date,timeIn,timeOut,notes,status) values('"
+ s2 + "','" + s3 + "','" + s4 + "','"
+ s5 + "','" + s6 + "','" + s7 + "','" + s8 +"')";
stmt.addBatch(sql);
System.out.println(sql);
}
stmt.executeBatch();
stmt.close();
conn.close();
response.sendRedirect("dailyAttand.jsp");
} catch (Exception e) {
out.println(e);
} finally {
out.close();
}
output show: | 24-05-2017-3|875236457854|2017-05-24|0700|1700|ok|Hadir
View Answers
Ads
Related Tutorials/Questions & Answers:
how to insert array data into sql server using jsp
how to
insert array data into
sql server using jsp hello,
i have problem to
insert array data into my
sql server from
jsp form. beloW is my code... from form, but not
insert into my
sql database.
try {
//String
how to insert data into database using jsp & retrive
how to
insert data into database
using jsp & retrive Hello,
I have created 1 html page which contain username, password & submit button. in my oracle10G database already contain table name admin which has name, password
Advertisements
how to insert data in database using html+jsp
how to
insert data in database
using html+jsp anyone know what...";
// declare a connection by
using Connection interface... that is used for executing
sql
statements. */
Statement stmt
how to insert checkbox value into database using jsp
how to
insert checkbox value into database
using jsp
How to
insert check box value to the oracle database
using jsp?
I want to create hotel's...;
Here is a simple
jsp code that
insert the selected checkbox values
how to insert checkbox value into database using jsp
how to
insert checkbox value into database
using jsp
How to
insert check box value to the oracle database
using jsp?
I want to create hotel's package. where the admin will select the activities to
insert in the PACKAGE table. I
how to insert data into databasse by using jdbc
how to
insert data into databasse by
using jdbc â?¢ Create a Registration Form with 10 input fields
using HTML and get those inputs
using JSP and
insert those inputs into database
using JDBC.
Here is a
jsp code
how to insert data into databasse by using jdbc
how to
insert data into databasse by
using jdbc â?¢ Create a Registration Form with 10 input fields
using HTML and get those inputs
using JSP and
insert those inputs into database
using JDBC.
Here is a
jsp code
how to insert data into databasse by using jdbc
how to
insert data into databasse by
using jdbc â?¢ Create a Registration Form with 10 input fields
using HTML and get those inputs
using JSP and
insert those inputs into database
using JDBC.
Here is a
jsp code
how to insert data into databasse by using jdbc
how to
insert data into databasse by
using jdbc â?¢ Create a Registration Form with 10 input fields
using HTML and get those inputs
using JSP and
insert those inputs into database
using JDBC.
Here is a
jsp code
Insert Data into Database Using Hibernate Native SQL
Insert Data into Database
Using Hibernate Native
SQL...
how you can use Native
SQL with hibernate. You will learn
how to use Native to
insert data into database. Native
SQL is handwritten
SQL for all database
How to insert clob data??
How to
insert clob
data?? Can any one tell me in details
how to populate clob column in a table
using sql??I tried simple
sql statements but found... of
data and need pl/
sql to avail that feature.Can any one tell me
how to create