Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6840467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:50:53+00:00 2026-05-26T23:50:53+00:00

I have created autocomplete textbox using jquery, but am getting the ORA: 00933 SQL

  • 0

I have created autocomplete textbox using jquery, but am getting the ORA: 00933 SQL Command Not properly ended exception in my jsp page..This is my code

autocompleteTB.html

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Auto Complete</title>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
function lookup(inputString) {
if(inputString.length == 0) {
$('#suggestions').hide();
} else {
$.post("states.jsp", {queryString: ""+inputString+""}, function(data){
if(data.length >0) {
 $('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
});
}
}
function fill(thisValue) {
$('#inputString').val(thisValue);
setTimeout("$('#suggestions').hide();", 200);
}
</script>
<style type="text/css">
 body {
 font-family: Helvetica;
 font-size: 13px;
 color: #000;
 }
 h3 {
 margin: 0px;
 padding: 0px;
 }
 .suggestionsBox {
  position: relative;
  left: 260px;
  margin: 0px 0px 0px 0px;
  width: 200px;
  background-color: #7845DD;
  -moz-border-radius: 7px;
  -webkit-border-radius: 7px;
  border: 2px solid #000;
  color: #fff;
  }
  .suggestionList {
   margin: 0px;
   padding: 0px;
   }
   .suggestionList li {
    margin: 0px 0px 3px 0px;
    padding: 3px;
     cursor: pointer;
     }
   .suggestionList li:hover {
   background-color: #DD45CD;
   }
   </style>
   </head>
   <body>
   <div>
    <form>
    <div> <h3><font color="red">Name</font></h3> 
    <br /> Enter Name to see auto complete
     <input type="text" size="30" value="" id="inputString" onkeyup="lookup          (this.value);" onblur="fill();" />
   </div>
   <div class="suggestionsBox" id="suggestions" style="display: none;">
   <div class="suggestionList" id="autoSuggestionsList">
    </div>
    </div>
    </form>
     </div>
     </body>
      </html>

status.jsp

    <%@ page language="java" import="java.sql.*" %>
    <% response.setContentType("text/html");%>
    <%
     String str=request.getParameter("queryString");
     try {
    String connectionURL = "jdbc:oracle:thin:@localhost:1521:root";
    Connection con;
     Class.forName("oracle.jdbc.driver.OracleDriver");
    // Get a Connection to the database
   con = DriverManager.getConnection(connectionURL, "dummy", "dummy"); 
    //Add the data into the database
    String sql = "SELECT Name FROM Employee WHERE Name LIKE '"+str+"%' LIMIT 12";
    Statement stm = con.createStatement();
    stm.executeQuery(sql);
    ResultSet rs= stm.getResultSet();
    while (rs.next ()){
  out.println("<li onclick='fill("+rs.getString("Name")+");'>"+rs.getString("Name")   +"</i>");
  }
     }
   catch (Exception e){
  out.println("Any Exception: " +e.getMessage());
   }   
     %>

The above code..when I enter a name in the textbox…it displays the SQL Exception…Please can anyone look into my code and correct me…am stuck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:50:54+00:00Added an answer on May 26, 2026 at 11:50 pm

    There is no LIMIT clause in Oracle.

    You could use

    SELECT Name FROM Employee WHERE Name LIKE ? and rownum < 13
    

    In addition to that, you have quite an SQL injection vulnerability there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an autocomplete textbox using jquery which will be bound
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a C# class file by using a XSD-file as an input.
I have created a foreign key (in SQL Server) by: alter table company add
I have created a keyboard using asp:button control. Onclientclick event it will display the
I am implementing YUI autocomplete in my project. I have created a web service
I'm using the nifty 'combobox' variant of jQuery UI Autocomplete - see here: http://jqueryui.com/demos/autocomplete/#combobox
I'm using Joomla 1.5. I have created a custom component that pulls data out
I'm implementing a Google Suggest like autocomplete feature for tag searching using jQuery's autocomplete.
I have a tagging plugin similar to that of SO. I use jQuery.ui's autocomplete

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.