how to insert array data into sql server using jsp

Ads
 

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 data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB:student; @table:stu_info; Combobox values:(class1,class2,class3); textbox1
How to insert multiple drop down list data in single column in sql database using servlet
How to insert multiple drop down list data in single column in sql database using servlet  i want to insert date of birth of user by using separate drop down list box for year,month and day into dateofbirth column in sql server
how to insert image into server
how to insert image into server  how to insert an image into sql server and retrieve it using jSP
How to insert image in sql database from user using servlet
How to insert image in sql database from user using servlet  pls tell me accept image from user and insert image in sql server 2005 database using servlet and jsp
insert and retrive image from sql server database in jsp
insert and retrive image from sql server database in jsp  what is the code to insert and retrive an image from sql server database in jsp
how to insert multiple columns of a single row into my sql database using jsp
how to insert multiple columns of a single row into my sql database using jsp  hi sir, how to insert multiple columns of a single row into my sql database using jsp. when i click ADD ROW,rows are added.when i click submit
Using C# DataGridView to insert record into Microsoft SQL Server 2005 database - SQL
SQL Server. What is the correct of using DataGridView to insert data into SQL...Using C# DataGridView to insert record into Microsoft SQL Server 2005... creating a sales database system using C# and Microsoft SQL Server 2005. I had
how to read data from excel file through browse and insert into oracle database using jsp or oracle???
how to read data from excel file through browse and insert into oracle database using jsp or oracle???  sir.. i have number of excel sheets which... a browse button which can upload a excelfile and after uploading the data should
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
how to connect SQL Server 2005 using php
how to connect SQL Server 2005 using php  i need to connect SQL Server 2005 using php. how can i connect . how to use mssql_connect function
how insert data from databse in array and compare new data to already stored value in array
how insert data from databse in array and compare new data to already stored value in array   hello all i tried to fetch data from databse and try to stored it in an array and i want to compare new value that come from database
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...) { String array[][]={{"1","Angel","Delhi"},{"2","John","Chennai"},{"3","William
Insert data in mysql database through jsp using prepared statement
; This is detailed jsp code that how to insert data into database by using prepared statement... Insert data in mysql database through jsp using prepared statement...; <HEAD> <TITLE>insert data using prepared statement </TITLE>
retriving data from sql server using jsp code and placing them in text fields of html code
retriving data from sql server using jsp code and placing them in text fields of html code  Hi, my question is how to retrieve data from sql server 2008 using a jsp file and place the values in the text fields of a html file
how to insert data from database using oops concepts - Development process
how to insert data from database using oops concepts  Hi, How to insert data from database using oops based concepts.please write the code... the following code: import java.sql.*; class Insert{ public static String url
How to upload files to server using JSP/Servlet?
How to upload files to server using JSP/Servlet?  How to upload files to server using JSP/Servlet
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 database using jsp my code is <link href="font&colors.css" rel="stylesheet" type="text/css"> <p></p>
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 the bulk data into the data base from the table of jsp page to another jsp page
how to insert the bulk data into the data base from the table of jsp page... to get values in array in next jsp page and insert into the row by row Please do... to insert the marks details into the data base i have retrive the rollno and name
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 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 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
How to insert data from textfields into database using hibernate?
How to insert data from textfields into database using hibernate?   try{ Session session = HibernateUtil.getSessionFactory().openSession...); System.out.println("Successfully data insert in database"); tx.commit
Insert a row in 'Mysql' table using JSP Code
Insert a row in 'Mysql' table using JSP Code In this section, we will discuss about how to insert data in Mysql database using JSP code. Query.../sql_developer/files/thirdparty.htm And paste it in " jre\ lib\ ext "
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data... to insert data

Ads