Statement « Database « JSP-Servlet Q&A

1. invalid sql statement in servlet

In login page i make validation that user is allowed to enter system , i make methode which validate user:

 boolean isValidUser(Connection con,String userName,String pass ){}
it works correctly in desktop ...

2. delete multiple rows in one statement in jsp taking dynamic java variable


<form action="test.jsp">
    <input type="checkbox" name="id" value="Java"> Java<br>
    <input type="checkbox" name="id" value=".NET"> .NET<br>
    <input type="checkbox" name="id" value="PHP"> PHP<br>
    <input type="checkbox" ...

3. how to prevent SQL Injection in JSP?

I'm pretty new in jsp, I'm playing with languages this 2 years, just say stop to me ^^, Last week I was doing some PHP stuffs, I've done a lil solution to ...

4. multiple db statements in a jsp page

Yes, keeping business logic separated from presentation logic is the main reason. Despite the ability to include Java scriplets in JSPs, you want to keep these down to a minimum. This makes it easier to maintain the page and keeps the JSP focused primarily on presentation. Using tag libraries helps keep the JSP scriplet-free because tags in effect "wrap" logic into ...

5. Prepares Statement : No ResultSet was produced

I am getting the following error if i am trying to execute this code. javax.servlet.ServletException: No ResultSet was produced WHAT DOES THIS MEAN? CANT I USE PREPARE STATEMENT WITH UPDATE QUERIES?. <%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ page import="java.lang.*" %> <%@ page import="java.lang.String" %> <%@ page import="*" %> <%@ page import="resume1.Resume" %> <%@ page session="true"%>

6. Can you use nested sql statements in jsp??

HI, I was wondering if you can use nexted sql statements... example... <%@ page language="java" contentType="text/html" %> <%@ page import="java.sql.*" %> <%@ page import="forum.DataAccess" %> <% // Create a new instance of the DataAccess Class DataAccess d = new DataAccess(); // This call the database connection method from the DataAccess Class d.ConnectDatabase(); /* This gets the threads from database for the ...

10. sending/retrieving data via SQL statements...

hey, I have 3 pages here index:


Select an Operation :
 1 - Add Record
2 - Delete Record
3 - Update Record
4 - Display Records
5 - update by name


11. Using SQL statements in JSP

Originally posted by Dilshan Edirisuriya: But sometimes i face situations where i couldnt do so. Like in resulset navigations it will be time consuming when you using another bean. So how should i cope up with this situation? You can still do the query in Java. You get the records that will be displayed in the JSP and store them in ...

15. Session variables in sql statements

16. View SQL statements generated by WebSpere App Server

Thanks Daniel and Jeanne. Just to clarify; I am using WAS7.0 as my app server; I have CMP beans which are doing CRUD operations, for this its obvious it must be generating sql statements behind the scene. I wanted to know that is there any configuration parameter in ejb-jar.xml or WAS profile which enable me to log these sqls in log ...

17. ** URGENT help running two SQL statements in JSP **

1. Your question is no more urgent to us than any other question in this forum, it's arrogant of you to think so. 2. A String is a String not a boolean and as such cannot be true unless you mean the String "true". Similarly a ResultSet is not a boolean and as such cannot be true. So define what you ...