I try to connect to hyperion database on via jboss and run sql statement. I have the followin jsp file:
<%@ page import = java.sql.* %>
<%@ page import = java.* %>
<%@ page language="java" contentType="text/html; charset=windows-1255"
pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>Insert title here</title>
</head>
<body>
IntialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("java:/DefaultDS");
Connection con = ds.getConnection();
PreparedStatement prSelect =
con.prepareStatement("select * from public.users where user = ?");
prSelect.getString(1,genre);
ResultSet rs = prSelect.executeQuery();
while (rs.next()) {
system.out.println("FOUND!!!!!");
}
</body>
</html>
I get this error message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /SearchGenre.jsp(1,20) quote symbol expected org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:200) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:150) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162) org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:451) org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:392) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:173) org.apache.jasper.compiler.ParserController.parse(ParserController.java:103) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167) org.apache.jasper.compiler.Compiler.compile(Compiler.java:306) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
what is my problem?
<% %>
symbols to wrap your code and make it scriptlet. If you don't, then use atry/catch
block to wrap it and provide the exact stacktrace of your problem. – Luiggi Mendoza