jsp_mysql

Ads
 

jsp_mysql

hi,, plz help me by providing the code for displaying SELECTED columns from mysql table which are given dynamically through checkboxes.... i created dynamic page to display columns in the table but how to handle them and display ...here is the code <%-- Document : columns Created on : Mar 1, 2012, 12:17:14 AM Author : cc --%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" import="java.sql.*"%>
<html>
<head><title>Read from mySQL Database</title>
    <link rel="html" href="css.html" type="text/css">
</head>
<body>
 <p align="center"><b>Fields In the table.</b><br>&nbsp;</p>

<div align="center" width="85%">
    <a id="currenttab" href="columns.jsp">columns</a>
    <a href="delete.jsp">delete</a>
<center>
<table border="1" borderColor="#ffe9bf" cellPadding="0" cellSpacing="0" width="658" height="63">
<tbody>
<%
String DRIVER = "com.mysql.jdbc.Driver";
Class.forName(DRIVER).newInstance();


Connection con=null;
ResultSet rst=null;
Statement stmt=null;
String temp=null;

try{
String url="jdbc:mysql://localhost:3306/test";

int i=1;
con=DriverManager.getConnection(url,"root","root");
stmt=con.createStatement();
rst=stmt.executeQuery("select column_name from information_schema.columns where table_name='sam'");
while(rst.next()){

if (i==(i/2)*2){
%>
<tr>
<td bgColor="#ffff98" vAlign="top" width="47" align="center" height="19"><input type="checkbox" name="column"><%=rst.getString(1)%>.</td>

<%
}else{
%>
<tr>
<td bgColor="#ffcc68" vAlign="top" width="47" align="center" height="19"><input type="checkbox" name="column"><%=rst.getString(1)%>.</td>
</tr>
<% }

i++;

}
rst.close();
stmt.close();
con.close();
}catch(Exception e){
System.out.println(e.getMessage());
}
%>

</tbody>
</table>
</center>
</div>



</body>
</html>

thanks in advance......

View Answers

Ads









Related Tutorials/Questions & Answers:
JSP &MYSQL
JSP &MYSQL  Develop a web page for the telephone directory using jsp and mysql
jsp mysql
........... like that all requests nd comments should be display through jsp and mysql...jsp mysql  actually i want a page that has two frames nd in 1 frame i'l add a textarea to post some help nd nw when he clicks on post button it has
Advertisements
jsp/mysql connection
jsp/mysql connection  I am puttng the following files in the lib folder of jdk to connect jsp and mysql and in the lib folder of tomacat and in the lib folder of project of netbeans but I am unable to to connect jsp and mysql
jsp/mysql connection
jsp/mysql connection  I am puttng the following files in the lib folder of jdk to connect jsp and mysql and in the lib folder of tomacat and in the lib folder of project of netbeans but I am unable to to connect jsp and mysql
JSP - MySQL - Connection
JSP - MySQL - Connection  I can't connect mysql using jsp in my... to resolve this problem.I set classpath for the mysql connector jar (/home/aghiltu/apache-tomcat-6.0.26/lib/mysql-connector-java-5.1.8-bin.jar)..... And i also tried
jsp_mysql
jsp_mysql  hi,, plz help me by providing the code for displaying SELECTED columns from mysql table which are given dynamically through checkboxes...; <html> <head><title>Read from mySQL Database</title>
jsp and mysql
jsp and mysql  i have a form which contains dropdown list. i have to take the values to another jsp page and perform the calculation on the database... as it is and the new function value in the new jsp page.. im in the middle of the project
JSP with Mysql
JSP with Mysql  Hi sir, I trying to several time but i am not get an answer. My questions are 1. How to inserting same field data to different mysql table using jsp. That is creating a form with 5 fields,data's are same
how to connect jsp to mysql - Java Beginners
how to connect jsp to mysql  I m new in Mysql and JSP i m ceating.java file using bean file for connectivity but i m not able to connect jsp... me hw to conncet jsp with mysql this is connection file package connect
excel report fro jsp mysql
excel report fro jsp mysql  Dear Sir, I am facing some problem while generating excel report form mysql database using jsp code. With the help from... data. But I need your help for generating a excel file from mysql DB for blob
How to display all the rows in JSP ,MySQL select condition statement IN dept_table
How to display all the rows in JSP ,MySQL select condition statement IN dept_table  I iam unable to display all the rows in JSP select statement from MYSQL DB.i have used the below code:only first row that satisfy the condition
retrieve related data from database using jsp and mysql
retrieve related data from database using jsp and mysql  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list. if we change a value in a dropdown its related value must
Creat a folder, inside it upload and download files in jsp and mysql
Creat a folder, inside it upload and download files in jsp and mysql  Create one or more folder .inside it we can upload and download multiple files   Here is an application that will upload the file and save
Connect JSP with mysql
Connect JSP with mysql   ... how to connect to MySQL database from your JSP code. First, you need to create... tutorial of "How to connect to MySQL Database from JSP?": 2
Connect JSP with mysql
Connect JSP with mysql   ...; This query creates database 'usermaster' in Mysql. Connect JSP with mysql : Now in the following jsp code, you will see how to connect
question
question  i need a simple code to display all employees on leave using jsp and mysql
question
question  i need a jsp and mysql program to display all employees on leave
question
question  i need a simple jsp + mysql code for trigger after insert
question
question  i need to set trigger using jsp with mysql query,please help me
question
question  please give me a simple program using bean + jsp + mysql
report making in asp
report making in asp  Hi sir, Please give some example report making code for jsp and mysql
online address book
online address book  how to create online address book using jsp and mysql
How to connect mysql with jsp
How to connect mysql with jsp  how to connect jsp with mysql while using apache tomcat
Search operation in JSP page
Search operation in JSP page  How to perform search in jsp with MYSQL database plz help me
question
question  i need a jsp and mysql program to retrieve data from employee table and attendance table using user name and password at a time
jsp sql server 2005 connectivity
jsp sql server 2005 connectivity  your jsp mysql tutorial is very help full.Please tell me how to connect jsp with SQL server 2005
question
question  i need a simple jsp + mysql code to display all absentees.and please send,if have any option to send any notification message to user who forgot to mark attendance
question
question  Good morning sir, i need a jsp and mysql code to track attendance immediately,and if you have any idea about how to take absentees please send me that too
question
question  i need a jsp and mysql program to retrieve data from employee table and attendance table using user name and password at a time for a Sign in user
question
question  sir, i need a jsp+mysql query to select data from two table for a perticular user eg:select data from employee and leave table for john.please help me
photo viwer
photo viwer  i need coding for photo viewer using jsp mysql   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml

Ads