Insertion into database

Insertion into database

Hi,
I need code for inserting the multiple select box values into database.Please do send me the code.

Thanks for ur immediate replies its helping a lot.

View Answers

April 12, 2011 at 3:31 PM

1)selectmultiple.jsp:

<html>
<form method="post" action="insertmultiple.jsp">
<pre>
Select Languages  <select name="sel" multiple>
        <option value="English">English</option>
        <option value="Hindi">Hindi</option>
        <option value="French">French</option>
        <option value="German">German</option>
        <option value="Chinese">Chinese</option>
        </select>

          <input type="submit" value="submit">
        </pre>
        </form>
        </html>

2)insertmultiple.jsp:

<%@page import="java.sql.*"%>
<%
String languages="";
String lang[]=request.getParameterValues("sel");
for(int i=0;i<lang.length;i++){
    languages+=lang[i]+" ";
}

        try{
        Class.forName("com.mysql.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
        Statement st=con.createStatement();
        int i=st.executeUpdate("insert into student(languages) values('"+languages+"')");
        out.println("Data is successfully inserted into database.");
        }
        catch(Exception e){
        System.out.println(e);
        }
        %>









Related Tutorials/Questions & Answers:
Insertion into database
Insertion into database  Hi, I need code for inserting the multiple select box values into database.Please do send me the code. Thanks for ur immediate replies its helping a lot
File insertion into oracle database
File insertion into oracle database  How to Read and Insert a file (any format) into a Oracle database
Advertisements
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  how many arrays needed for insertion sort and why
hibernate insertion problem - Hibernate
hibernate insertion problem  Hi , Thanks for the material .Its very gud . when i run FirstExample.java i get the message insertion has been done int the table contact . but whne i look into database data is not inserted
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php
insertion in SQL - SQL
insertion in SQL  Hi! Everybody... i have a problem with sql insertion. When i am inserting values through command i.e. insert into employee values(,,,,); here i want to insert ' in employee name column of database
Insertion Sort Applet
Insertion Sort Applet  Please All , I need Insertion sort applet program
Insertion Sort Applet
Insertion Sort Applet  I need Insertion Sort Applet code was design by Dr. Daniel Liang Please
insertion sort applet code
insertion sort applet code  i need Insertion Sort Applet Program
Insertion Sort Timer
Insertion Sort Timer  Welcome all I wanna program in java find the timer of insertion sort and find time complexity for random value thanks all
insertion in SQL - SQL
insertion in SQL  Query is "insert into employee values('"+eno... in the database because of single code in the name. dbase is MS-SQL emp.name data type varchar(MAX). why I am not able to insert single codes in the database. As far
Java insertion sort question
Java insertion sort question  I've got another program that I need help with. I am trying to write a Java method that accepts an array of strings, and sorts the strings using the insertion sort algorithm. Then I need to write
Insertion Sort Problem
Insertion Sort Problem  So I have this in a class file. It is supposed to be an insertion sorter: int min, index=0, temp; for(int i=0;i<sorted.length;i++){ min=sorted[i]; for(int j=i+1;j<
Insertion Sort - Java Beginners
Insertion Sort  Hello rose india java experts.If you don't mind.Can you help me.What is the code for Insertion Sort and Selection Sort that displays LETTERS in alphabetical order from A to Z. Thank you.Hope you gonna helpme
insertion error - JSP-Servlet
insertion error  my first jsp page : In this i m getting all the values through a method called getAllDetails,the values are getting inserted but the problem is i have created frames , when i clicking on the link book halls
dynamic delete and insertion in tables
dynamic delete and insertion in tables  hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
dynamic delete and insertion in tables
dynamic delete and insertion in tables  hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
data insertion and fetch 1
data insertion and fetch 1  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type
PHP SQL Insertion
PHP SQL Insertion       PHP SQL Insertion is used to execute MySQL queries in PHP script... SQL Insertion'. To understand and grasp the example we create a table 'Stu
database
database  database
database
database  database application
Inserting content(DOM Insertion)
Inserting content(DOM Insertion)       Inserting content(DOM Insertion) Inserting... : DOM insertion DOM insertion, Around DOM
ModuleNotFoundError: No module named 'readgroup_platform_insertion'
ModuleNotFoundError: No module named 'readgroup_platform_insertion'  ...: No module named 'readgroup_platform_insertion' How to remove the ModuleNotFoundError: No module named 'readgroup_platform_insertion' error
Insertion Sort In Java
Insertion Sort In Java     ... In this example we are going to sort integer values of an array using insertion sort. Insertion sorting algorithm is similar to bubble sort. But insertion sort
database
database  the code for initializing the database connection
Binary search tree (insertion) urgent!!
Binary search tree (insertion) urgent!!  Create a program to construct a binary search tree consisting of nodes that each stores an integer in Java.Avoid duplication of values when inserting nodes in the tree. When a new leaf
database
database  i want to let the user select the name of database and then delete that database.......im doing project in swings netbeans
database
database  use of hyperlink to show the data from database
database
database  i need to insert time in my database. i need a code to insert time in my database. its very urgent
Issue with tutorial realted to insertion in middle in Linked List
Issue with tutorial realted to insertion in middle in Linked List  insert in middle in Linked list will take O(N) instead as displayed as O(1
database
database  im doing my project in netbeans swings...wn a user wants to create a database from the gui...i want to display an error msg if a database with that name already exists and if it does not exist new database should
database
database  tell me use about database and give me a small program.   It is secure and can easily be accessed, managed, and updated. Moreover... links: Connect JSP with database Mysql Connect Java with database Mysql
database
database  tell me use about database and give me a small program.   It is secure and can easily be accessed, managed, and updated. Moreover... links: Connect JSP with database Mysql Connect Java with database Mysql
database
database  tell me use about database and give me a small program.   It is secure and can easily be accessed, managed, and updated. Moreover... links: Connect JSP with database Mysql Connect Java with database Mysql
database
database  I wanted to know if it is possible to create a database in mysql by letting the user enter the name of the database in swing gui..im doing my project in netbeans...Thank You
database
database  I wanted to know if it is possible to establish database connection on a remote pc with mysql using java swings from netbeans and then create a database on the remote pc.... Kindly help me
DATABASE
DATABASE  How can i get combo box values from database?? or how can i get values in the drop down menu of the html which is similar to dat of combo box in java - from database
Database
Database  How to represent data from database in a tree?   Please visit the following link: Retrieve data from database in tree using Java Swing
Database
Database  I am working in jsf2.Fro a demo i created database in ms access.no wi want to retrive a record from database for a particular data.I need help as I am stuck
Database
Database  from java code i have to retrieve some data from a database, which is present in a different timezone. Scenario :- My database... in database timezone is 9PM 15APR2012. I want to retrieve something from database
DATABASE
DATABASE  I can't send different information from different form into a single table in my database
Database
Database  Can i get a code for database connectivity Myeclipse 3.3 to MySql manager 2005
database
database  dateofbirth is not save into the database while i am enter from html browser.it shows as null.whats the reason
database
database  sir.. how we can uplaod the database in the data file(ms access)please send me a solution
database
database  how we ca upload the data in the database file(ms access

Ads