wood burning stoves 2.0*
The moose likes JSP and the fly likes Sql Exception in Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Sql Exception in Jsp" Watch "Sql Exception in Jsp" New topic
Author

Sql Exception in Jsp

Arpit Kumar gupta
Greenhorn

Joined: Mar 19, 2013
Posts: 2
Hi.. friends i have a error in my jsp code please check it ..
Error : [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot find the input table or query 'null'. Make sure it exists and that its name is spelled correctly.
i give the data is correctly still its show the error... thanks in advance...
<%@ page import="java.sql.*,connection.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.leftbox_main{width:180px; height:1000px;}
.heading{ height:auto; font-size:20px; text-transform:capitalize; text-align:center;}
.price_box{ height:auto; text-transform:capitalize; text-align:left; padding: 4px 3px 0 0; margin-left:21px;}
.price_box_width{ width:30px; height:10px;}
.go_btn{ background:#00C; display:inline;}
.headingbox{ height:auto; }
.headingbox ul{text-decoration:none; list-style:none;}
.icn_color{

display: inline-block;
height: 13px;
width: 19px;
margin:0px 8px 0px 6px;
}
.btn{background:#00F; width:50px; height:20px;}
.
</style>
<script type="text/javascript">
function onbrand() {
document.arpit.submit();
}
function onsize() {
document.nitin.submit();
}
function oncolor() {
document.pallavi.submit();
}
function onprice() {
document.komal.submit();
}
</script>
</head>

<body>
<%! String table;
String product_type;
%>
<%
table=request.getParameter("table");
product_type=request.getParameter("product_type");
if(table==null && product_type==null)
{
table=request.getParameter("table2");
product_type=request.getParameter("product_type2");
System.out.println("arpit..................."+table+product_type);
}
Connection con=new DatabaseConnection().getConnection();
%>
<div class="leftbox_main">
<form name="arpit" action="SelectionLayout.jsp" method="get">
<div class="heading">Brands</div>
<div class="headingbox">
<ul>
<%
System.out.println("select distinct brand from "+table+" where product_type="+product_type);
PreparedStatement brand=con.prepareStatement("select distinct brand from "+table+" where product_type=?");
brand.setString(1,product_type);
ResultSet rsbrand=brand.executeQuery();
String br="";
while(rsbrand.next())
{
br=rsbrand.getString("brand");
%>
<li><input name="brand" type="checkbox" value="arpit" onclick="onbrand();"/><%=br %></li>
<%
}
%>
</ul>
<input type="hidden" name="table1" value="<%=table%>"/>
<input type="hidden" name="product_type1" value="<%=product_type%>"/>
</div>
</form>
</div>
</body>
</html>
d v lokesh venkata
Greenhorn

Joined: Aug 09, 2013
Posts: 16

please check whether the odbc drivers for that particular data base are installed correctly
Arpit Kumar gupta
Greenhorn

Joined: Mar 19, 2013
Posts: 2
i already checked that it is correct first time a call this jsp and send the data its working file and when i click any check box and the form auto load request goes to same jsp the the two parameter move on the current jsp..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sql Exception in Jsp
 
Similar Threads
javascript to jsp(i am sorry to post it once again please see the code i have everything ut does not
how to get input from javascript and pass to servlet
How to make my search box work
how to transfer data from javascript to jsp
Float problem