E ai pessoal!
Bom, eu fiz uma pagina jsp aqui de teste e estou tentando acessar o banco de dados atraves dela e esta dando um erro que ainda nao consegui achar a solução:
30/11/2009 09:24:57 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Unable to convert between net.sourceforge.jtds.jdbc.ClobImpl and INTEGER.
at net.sourceforge.jtds.jdbc.Support.convert(Support.java:648)
at net.sourceforge.jtds.jdbc.JtdsResultSet.getInt(JtdsResultSet.java:656)
at net.sourceforge.jtds.jdbc.JtdsResultSet.getInt(JtdsResultSet.java:983)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Minha pagina index.jsp
<%@page import="conexao.ConexaoBD"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="conexao.ConfiguracoeBDDAO"%>
<%
ConexaoBD conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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=ISO-8859-1">
<title>Pagina de teste</title>
</head>
<link rel="stylesheet" href="../CSS/lider.css" type="text/css" />
<body>
<div id="login">
<table width="550" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" width="496">Username</td>
<td width="125" height="24">CompName</td>
<td height="24" width="496">DocName</td>
<td height="24" width="496">Pages</td>
<td height="24" width="496">Tamanho</td>
<td height="24" width="496">Data</td>
<%
String UserName = "";
String CompName ="";
String DocName = "";
int Pages ;
int JobSize ;
Timestamp SubmitDate;
conn = new ConexaoBD(ConfiguracoeBDDAO.LOGIN, ConfiguracoeBDDAO.SENHA, ConfiguracoeBDDAO.DRIVER, ConfiguracoeBDDAO.URL);
conn.conectar();
System.out.println(ConfiguracoeBDDAO.LOGIN);
System.out.println(ConfiguracoeBDDAO.SENHA);
System.out.println(ConfiguracoeBDDAO.DRIVER);
System.out.println(ConfiguracoeBDDAO.URL);
ps = conn.getStatement("select * from BASE_JAC");
rs = ps.executeQuery();
while (rs.next()){
%>
<tr>
<td><%=rs.getString("UserName")%></td>
<td><%=rs.getString("ComputerName")%></td>
<td><%=rs.getString("DocName")%></td>
<td><%=rs.getInt("Pages")%></td>
<td><%=rs.getInt("JobSize")%></td>
<td><%=rs.getTimestamp("SubmitDate")%></td>
</tr>
<%
}
conn.desconectar();
%>
<tr>
<td colspan="2" align="center" valign="top"></td>
</tr>
</table>
</div>
</body>
</html>
Estou usando o driver de conexao jtds dessa forma:
DRIVER = "net.sourceforge.jtds.jdbc.Driver";
Minha url de conexao esta assim:
URL = "jdbc:jtds:sqlserver://NOTE/Teste_Lider;instance=SQLEXPRESS" ;
Estou enviando a senha normalmente e o usuario tambem, mas infelizmente ainda da o erro apresentado acima, alguem poderia me ajudar a resolve-lo? Grato desde ja pessoal