Share on Google+Share on Google+

mysql with jsp
1 Answer(s)      8 years ago
Posted in : Java Beginners


View Answers

October 24, 2008 at 11:38 AM

Hi friend,

Code to help in solving the problem :

<%@ page import="java.sql.*" %>
<form name="employee">
<table border="0" width="400px" align="center" bgcolor="#CDFFFF">
<div id="mydiv"></div>
<tr><td><b>Select Employee Id</b></td><td>
<select name="semp_id" >
<option value="-1">Select</option>

Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";;
String dbName = "databasename";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "root";

int sumcount=0;
Statement st;
try {

conn = DriverManager.getConnection(url+dbName,userName,password);
String query = "select * from tablename";

st = conn.createStatement();
ResultSet rs = st.executeQuery(query);


<option value="<%=rs.getString(1)%>"><%=rs.getString(1)%></option>



catch (Exception e) {




For more information on JSP visit to :


Related Tutorials/Questions & Answers:
JSP &MYSQL  Develop a web page for the telephone directory using jsp and mysql
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
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
JSP-Mysql - JSP-Servlet
JSP-Mysql  Hello friends, Anyone send me the way how to store image in mysql database from a jsp page.  Hi friend, Code to insert image in mysql Using Jsp : For more information on JSP
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_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/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
How to connect to MySQL in JSP?
How to connect to MySQL in JSP?  How to connect to MySQL in JSP..., You can use the Java JDBC code to connect to MySQL database in JSP page. Check the tutorial: Connect JSP with mysql Thanks
How to connect mysql with jsp
How to connect mysql with jsp  how to connect jsp with mysql while using apache tomcat
connection of jsp with mysql - JSP-Servlet
Example of connection between JSP and MYSQL  Need an example of connection between JSP and MYSQL
jsp with mysql bolb - JSP-Servlet
jsp with mysql bolb  how to display images from mysql bolb in jsp?(in my selected area)  Hi friend.... Thanks
connection to mysql in jsp
connection to mysql in jsp  please i got this error message when trying to connect to mysql database in jsp. Unknown character set: 'utf8mb4
jsp & mysql - JSP-Servlet
jsp & mysql  can anybody tell me hoe to overcome from following error i am facing this problem...plz help me... org.apache.jasper.JasperException: Communication failure during handshake. Is there a server running on localhost
jsp, mysql - Java Beginners
jsp, mysql  i want to store / insert the selected value in the combo box (jsp), into the mysql. how to do it?... pls help me in urgent
jsp,mysql - JSP-Servlet
jsp,mysql  hi i need a code to retrieve data to text boxes and move the records and also allow the user to change/delete the record SEMINARS THEME
connection of jsp with mysql - JSP-Servlet
connection of jsp with mysql  can anybody tell me about connection of JSP with MYSQL? and also tell me which version is compatible with tomcat 4.1 i am using tomcat 4.1, MYSQL 5.0 but i have problem with connection
mysql with jsp - Java Beginners
mysql with jsp  i wanted to insert a combo box value to mysql table usgin jsp. how to perform that. can anybody help me in urgent.  Hi... For more information on JSP visit to : http
connecting jsp to mysql - JSP-Servlet
connecting jsp to mysql  Hi, i am working on 'Web application development' project that uses JSP, MySQL and tomcat.i am not able to connect to the mysql database through jsp. After downloading the mysql-connector-java-5.0  
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
MySql - JSP-Servlet
MySql  Hello friends, I am developing a JSP project with back end MYSQL and i am using SQLYOG editor enterprise 7.11. I got the serial number also...; Hi friend, Thanks
interface to mysql - JSP-Servlet
interface to mysql  i am creating an easy accces to mysql through jsp-sevlets,when ever user enters the query through the interface how to retrieve the result from the database where the developer has to generally develope
js,,mysql - JSP-Servlet
js,,mysql  Hi, I want a jsp code for editing,deleting data retrieved from from the mysql database and displayed in a html page .Can anybody... link: Hope that the above
jsp using include & with mysql
jsp using include & with mysql  Sir, I am creating a login application using jsp & Mysql. The Codes are--- Html File...... <...; Jsp file....... <%@ page import="java.sql.*" %> <% String
mysql jsp - Java Beginners
mysql jsp  how to insert values to mysql? i want to insert values from a combo box to mysql... how to perform that. pls help me in urgent.  Hi friend, Plz give full source code where you having the problem
mysql - JSP-Servlet
mysql  code to add photo in mysql database ... i want page from which i can upload photo which will store in mysql database and display in one page in jsp...  Hi Friend, Try the following code: 1)page.jsp
Backup MySQL Database - JSP-Servlet
Backup MySQL Database  Database Sir I have been reading Rose's india tutorial "Using MySQL Database with JSP/Servlet". In the Tutorial you have shown an example of backing up the database. When I tried to backup database
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
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 fetch image from mysql using jsp
how to fetch image from mysql using jsp  how to fetch image from mysql using jsp
problem connect jsp and mysql - JSP-Servlet
problem connect jsp and mysql  hello, im getting an error while connecting jsp and mysql. I have downloaded the driver mysql-connector... Software Foundation\Tomcat 5.5\common\lib\mysql-connector-java-2.0.14.jar
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized


Advertisement null