Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL how do i use sql like query in my jsp page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


tatoomorgan
how do i use sql like query in my jsp page
2 Answer(s)      3 years and 11 months ago
Posted in : SQL


how do i use sql like query in my jsp page


Advertisement
View Answers

December 1, 2010 at 2:36 PM


Hi Friend,

Try the following code:

<%@ page import="java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:student");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from data where name like 'a%'");
while(rs.next()){
out.println(rs.getString("name")+"<br>");
}
%>

The above code will display all the names from the database that starts with character 'a'.

Thanks



August 1, 2012 at 2:06 PM


String sql = "select * from EXPERIENCE1 where EXPERIENCE1.RESUMEKEY="'"+RESUMEKEY+'" and EXPERIENCE1.EXPERIENCESEQ='"+EXPERIENCESEQ+'" ";



Related Tutorials/Questions & Answers:
how do i use sql like query in my jsp page
how do i use sql like query in my jsp page  how do i use sql like query in my jsp page   Hi Friend, Try the following code: <%@ page... where name like 'a%'"); while(rs.next()){ out.println(rs.getString("name")+"<
how do i provide down a pdf document fecility on my web page using jsp and servlets?
how do i provide down a pdf document fecility on my web page using jsp and servlets?  Hai, I need a program to provide download option for pdf file on my web page,the pdf file contains retrieved data from mysql table. I need
Advertisements
how to display jsp page containing mysql query in particular division using ajax ?my code is below bt i cundt get it properly
how to display jsp page containing mysql query in particular division using ajax ?my code is below bt i cundt get it properly   index.html <...: <%@page import="java.sql.*"%> <% String emp_name
How could I use Socket in my application?
How could I use Socket in my application?  I created an application dealing with the management of a supermarket using Hibernate and Swing. I found out today that I have to use also Socket and I don't know exactly what I could do
how i open my web page
how i open my web page   how i open my web page on different broadband machine if i don't have any domain name... i m using a broadband .........i... localmachine/localhost:8080/app/app.htm so tell me step how i open my page
how to call list objects as string into my sql query?
how to call list objects as string into my sql query?  how to call list data as string into my sql query so that i can retrieve all values from database? List has data retrieved from xml(using xmlSAXparser
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?  this is count record code <%@ page language="java" import="java.sql.*" %> <html> <head>
how to create a jsp page like gmail inbox page
how to create a jsp page like gmail inbox page  in my struts project i need to create a page like gmail inbox page..........how can i create this? help me some one
How to use sum sql query to process the summed data into a list?
How to use sum sql query to process the summed data into a list?  Im get stuck to get sum of data in database. Then i need to list the summed of data in jsp page. For example, i have a database named family that store
How to use sum sql query to process the summed data into a list?
How to use sum sql query to process the summed data into a list?  Im get stuck to get sum of data in database. Then i need to list the summed of data in jsp page. For example, i have a database named family that store
PHP SQL LIKE Operator
PHP SQL LIKE Operator       This example illustrates how to use the like operator in sql query.... $result = mysql_query("select * from emp where name like 's%'"); In the query
How to use Jquery in jsp page
How to use Jquery in jsp page  Hello Sir, I am... in my jsp page. I have heard that jquery will be usefull for this work. According to my need in my gridview i have to add following functionaliies
how do i make a phone call from my app without quitting my application
how do i make a phone call from my app without quitting my application  hi, I am working on creating a call application, i am making a call from my... quits , i want my application to go to background and resume on call end ...please
I want to change my user name on your website ,how can i do this
I want to change my user name on your website ,how can i do this  I want to change my user name on your website ,how can i do this   You can create another account very easily with different username
how can i use toggle button in my application
how can i use toggle button in my application  i want a on/off toggle button by dragging left-right..not by pressing on button
How to use 'for' loop in jsp page?
How to use 'for' loop in jsp page?       This is detailed java code that shows how to use 'for' loop in jsp page. 'if' statement is used to test conditions while
how i do url encoding process - JSP-Servlet
how i do url encoding process  hai to all how i do the url encoding., when i passing data from one jsp page to another page,while passing some... post method., but here i want some of the url encodings plz help me., thanx
How to use an object properties in jsp page
How to use an object properties in jsp page  I have a arraylist of objects 'User' populated using struts 2 action class while loading that jsp page... of hardcoded value 'AMIT' I want to use value of User object. How can I do it? Please
How save,get picture from database in my jsp page?
How save,get picture from database in my jsp page?  How i save picture in db after browsing it,and also how i get it on my other jsp page
How to use 'if' statement in jsp page?
How to use 'if' statement in jsp page?  ... how to use 'if' statement in jsp page. This statement is used to test... this code as a .jsp file named "use_if_statement.jsp"
how do i update my database with the help of update syntax in html <text/javascript>? How to write 'where' statement in this?
how do i update my database with the help of update syntax in html ? How... ActiveXObject("ADODB.Recordset"); alert('How are you!!'); cn.Open(strConn); alert('I am Fine!'); rs.Open(sqlmek, cn); alert('Fine
PHP SQL LIKE Operator
PHP SQL LIKE Operator This example illustrates how to use the like operator in sql query. The LIKE operator is used in a WHERE clause to search... like 's%'"); In this query we want to find the name which end with h
how do i upload a file by using servlet or jsp?
how do i upload a file by using servlet or jsp?  hi plz tell me the write java code
How do i start to create Download Manager in Java - JSP-Servlet
How do i start to create Download Manager in Java  Can you tell me from where do i start to develop Download manager in java
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end user he does not know to run server by service runner... and he does not know
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end user he does not know to run server by service runner... and he does not know
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end user he does not know to run server by service runner... and he does not know
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end user he does not know to run server by service runner... and he does not know
how i can add an horizontal scrollbar at my PdfAnnotation ? - JSP-Servlet
how i can add an horizontal scrollbar at my PdfAnnotation ?  How to add the an horizontal scrollbar at my PdfAnnotation ? for example document d=new document(0. document.open
How do I use JGraph to create a MST(minimum spanning tree) using java?
How do I use JGraph to create a MST(minimum spanning tree) using java?  How do I use JGraph to create a MST(minimum spanning tree) using java? thanks for the help
how to connect jsp with sql database by netbeans in a login page?
how to connect jsp with sql database by netbeans in a login page?  how to connect jsp with sql database by netbeans in a login page
Advertisements
 

 

 

DMCA.com