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



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

Have Programming Question? Ask it here!
 
 
 


tatoomorgan
how do i use sql like query in my jsp page
2 Answer(s)      3 years and 8 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 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 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 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
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
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 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 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 '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 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 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 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
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
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 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 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 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 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
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
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
SQL Query - JSP-Servlet
SQL Query   AS mysql backend updation query shows a syntax error. I gave the full query and the generated error here. Please send me the correct query anyone. st.executeUpdate("update stud_detail set name='"+newname
How can I to my database to my application
How can I to my database to my application  How can I to my database to my application   Hi, Please see the JDBC discussion thread. Thanks
use struts 1.0 to view sql table value on JSP page
use struts 1.0 to view sql table value on JSP page  Here i am using struts 1.0 to view my sql table values on jsp page. But the problem is when i append the value in bean then i find the last row of table is shown repetedly. Any
use struts 1.0 to view sql table value on JSP page
use struts 1.0 to view sql table value on JSP page  Here i am using struts 1.0 to view my sql table values on jsp page. But the problem is when i append the value in bean then i find the last row of table is shown repetedly. Any
How can I do it? .click();
How can I do it? .click();  I have a very unusual problem. I want to make a script like this: <script> x = document.getElementById... want that it make mouseup in this element. How can I do it, because if I write
How do I upgrade mysql?
How do I upgrade mysql?  How do I upgrade mysql
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers  how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
What do I need to do to use a MSSQL-Server with Web-Harvester?
What do I need to do to use a MSSQL-Server with Web-Harvester?  What do I need to do to use a MSSQL-Server with Web-Harvester
can i use big query in hibernate?
can i use big query in hibernate?  can i use big query in hibernate
how to use dropdown list in JSP and display value in same page
how to use dropdown list in JSP and display value in same page  I... in the same page Value selected = C How can we do this in a JSP page... one option the value must get displayed below it in the same page
How to use 'continue' keyword in jsp page ?
How to use 'continue' keyword in jsp page... that shows how to use 'continue' keyword in jsp page. The continue statement skips... have developed use_continue_statement.jsp page which shows the use of 'continue
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 do i solve this problem?
how do i solve this problem?  Define a class named Circle... the surface area of the Circle object. Use the constant PI value for the calculation... object is circumference. Use the constant PI value for the calculation. Write
How do i get the number of online users from a site using jsp?
How do i get the number of online users from a site using jsp?  Hi, Can any one tell me how to get the number of records from a database dynamically, when each person got logged into the page in jsp
how do i solve this question?
how do i solve this question?  1.Define a class named Circle...() that calculates and returns the surface area of the Circle object. Use...() that calculates and returns the Circle objectââ?¬â?¢s circumference. Use
how to use group by in nested query
how to use group by in nested query  Hai, How to use group by clause in nested query select statement in subquery i am having where clause.please help me.thanks in advance
How to use radio button in jsp page
How to use radio button in jsp page       This is detailed java code how to use radio button in jsp code and display a message in another jsp page according
Advertisements
 

 

 

DMCA.com