Home Answers Viewqa JDBC Problem in executing query....

 
 


Mainak
Problem in executing query....
2 Answer(s)      a year and a month ago
Posted in : JDBC

Suppose there is a textbox or a text area and the user is supposed to enter any text.Suppose the user enters his text and his text contains a '(inverted comma) somewhere in his text.I fetch this data with request.getParameter() but when I execute the query to store in oracle it is showing error because of the '.I understand where the problem is.If the user does not enter ' then there is no problem while executing.But suppose the user gives it.How can I solve the error....

View Answers

April 4, 2012 at 11:26 AM


The given code will not allowed the user to enter any special characters.Check it.

<script>
function ch(){
var str=document.getElementById("text").value;
var desired = str.replace(/[^\w\s]/gi, '');
document.getElementById("text").value=desired;
}
</script>
<pre>
Enter String <input type="text" id="text" onkeydown="ch();">
</pre>

April 4, 2012 at 3:04 PM


Then there is a restriction on the characters the user can enter.But how is it that sites like facebook,google and other sites allow the user??In these sites the user can easily enter whatever character he likes??Is there any other solution??









Related Pages:
Problem in executing query....
Problem in executing query....  Suppose there is a textbox or a text... this data with request.getParameter() but when I execute the query to store in oracle it is showing error because of the '.I understand where the problem is.If
select Query result display problem
]); } when I am executing the above query the following error will happend...select Query result display problem  Hi, String SQL_QUERY ="from Cc"; Query query = session.createQuery(SQL_QUERY); for(Iterator it=query.iterate
query problem
query problem  how write query in jsp based on mysql table field? i have employee table it contain designation field, how write query in jsp... to write this query in jsp please anybody help me, and send me that code
problem with executing JSF file(Build failed)
problem with executing JSF file(Build failed)  *while executing below code i am getting problem as **init: deps-module-jar: deps-ear-jar: deps-jar: library-inclusion-in-archive: library-inclusion-in-manifest: compile
query
query  what is jre????? why java is robust in nature??????? why it is platform independent???????   Hi, JRE: Java Runtime Environment or JRE is the run time for executing the Java applications. Read more about JRE
Executing Set of SQL statements in Java
the code for saving the data in excel but the code for executing the query...Executing Set of SQL statements in Java  Hi, I am trying to execute a procedure which is stored in MS SQL server's database. I have configured
Executing JAR file - Swing AWT
Executing JAR file  Hello Friends! I have successfully... Manifest.txt secl/*.class and my jar file is created. But there is a problem, when... will exit! How can I solve this problem? Please help me
Problem in executing macro enabled excel sheet using java
Problem in executing macro enabled excel sheet using java  Hi, I have written a java code which will read a excel sheet with macro enabled. then it will write data into sheet1 and sheet2 and it will execute a VB script
delete query problem - Hibernate
correctly , the problem is only delete query. 2) query.executeUpate(); ->...delete query problem  SessionFactory fact = new Configuration...'"; Query query = sess.createQuery(hql) query.executeUpate(); // int row
executing mysql plsql block using hibernate
executing mysql plsql block using hibernate  I got one requirement like this, I have to execute following query by using hibernate DECLARE @i_STARTDATETIME DATETIME DECLARE @i_ENDDATETIME DATETIME DECLARE @o_ERRORCODE INT
creating and executing stored procedure using hibernate
creating and executing stored procedure using hibernate  I have to execute following query using hibernate DECLARE @i_STARTDATETIME DATETIME DECLARE @i_ENDDATETIME DATETIME DECLARE @o_ERRORCODE INT DECLARE @o_ERRORDESCRIPTION
Executing code upon folder/drive access
Executing code upon folder/drive access  I would be glad if someone could show me how to make your program in jar format execute when the folder... this will solve your problem. Thanks
Problem in updating query in Hibernate - Hibernate
Problem in updating query in Hibernate  Hi, I have used a query to update the existing columns of one table. The query updates the records in the main table but it does not update the tables that are mapped from the main table
problem in insert query - JSP-Servlet
problem in insert query  Hi! I am using this statement for data...   Hi friend, We check your Query it is correct .If you have problem plz give full details with source code and visit to : http
MS-ACCESS Query Problem - SQL
MS-ACCESS Query Problem  hi sir i have table which is initially... tables Course and Class wise Ex..Query like: if we execute this Query... records so these all records i want to insert into Deleted Table plz can u give Query
Executing Prepared Statement
; } Executing Prepared Statement Prepared Statement represents the pre-compiled query with parameter and no-parameter. An example given below... a query String query = "SELECT * FROM student"; try { // Compiling query
Problem with Hibernate or 11g
Problem with Hibernate or 11g  Hi I am using Hibernate and 11g in my project. The problem I am facing is I am executing a query from java class... on Created date column by using hibernate query language. The Problem is every
JPA Named Query
executing the query. Types of query: Static query (Named query) Dynamic... JPA Named Query       In this section, you will read about the JPA Query, its types
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select length(ename)||' charecters exist in '||initcap(ename)||'s name' as "names and length" from emp
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select initcap(ename),job from emp where substr(job,4,length(job,4,3)))='age
executing a batch file which depends on jar files from a system tray but console should not display.
executing a batch file which depends on jar files from a system tray but console should not display.  Hi all, I got following requirement, I have... in a system tray. Please help me in resolving this problem. Am not receiving
while executing a java program
while executing a java program  while iam executing a simple java program after i type "java simple.java" there was a an error occuring.the error is "exception in thread "main" java.lang.noclassdeffounderror:simple" what thus
PHP SQL Query
PHP SQL Query       This example illustrates how to create and execute the sql query in php... and fetch the data. This interaction is made executing Sql queries. To understand
executing Hibernate application
executing Hibernate application  when i am executing the hibernate application the following error occured. log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). /hibernate.cfg.xml not found log4j
ERRor in executing DB program
ERRor in executing DB program  While executing following code an Error was generated.can any one help me for this. LiveDB liveDBObj = DataSourceFactory.getLiveDBInstance(); PreparedStatement pstmt=null; String qry=""; qry
problem on php
problem on php   l have five tables and build them as forms and link between them php and database and i want to build query between them plz help me soon   PHP MySQL Tutorials
query on struts2 - Struts
query on struts2  I am using struts2 for my application.i have a form that contains 'select' tag, for this i am getting values form DB. The problem is after i am submitting the form it is giving the following error
Hibernate Isolation Query. - Hibernate
Hibernate Isolation Query.  Hi, Am Using HibernateORM with JBOSS server and SQLSERVER.I have a transaction of 20 MB, when it is getting processed... for the problem
query regarding arraylist
query regarding arraylist  i m using sql server + jsp to develop my program. i have a problem of fetching data from the table in database. i m storing my keys in arraylist, now i want to get data according to that keys. keys
solve this problem
in table please tell me the solution for thid problem import java.io.*; import...(url); Statement statement = conn.createStatement(); String query... = statement.executeUpdate(query); if(i!=0){ out.println("The record has been inserted
small query - JSP-Servlet
small query  how to set value to textbox on browser side which is retrived from the database?  Hi friend, Plz explain problem in details which technology you have used e.g. JSP/Servlet/Java etc... For more
mysql query - WebSevices
kathiresan.. Here is the php code which solve your problem.. Thanks
need search query - WebSevices
, Please try the following code. It will be helpful in solving your problem
Javascript & AJAX query - Ajax
the problem and follow some points : Step 1: Create a web page ("addperson.jsp
SQL query - SQL
SQL query  hi sir/Madam i am using MS Access where i have table like Fees_Struc: Amount (INT) Due_Date (Date) Fees_Pay: Paid(INT) Student_Bal: Panalty(INT) my problem is when the Due_date is equal
executing java program with 2 classes
executing java program with 2 classes  how to run a program of java containing more than one class....ex of program is given below.... class C...); } }   Executing java program with 2 classes save the file with D.java

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.