Olá pessoal,
Tenho um projeto no J2EE no NetBeans utilizando um BD MySql. Abaixo segue os parâmetros para conexão com o MySql só para explicar melhor. Agora utilizarei o Driver ojdbc14.jar para conectar no Oracle
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>jdbc_driver</param-name>
<param-value>org.gjt.mm.mysql.Driver</param-value>
</context-param>
<context-param>
<param-name>jdbc_url</param-name>
<param-value>jdbc:mysql://localhost:3306/agenda</param-value>
</context-param>
<context-param>
<param-name>jdbc_user</param-name>
<param-value>usuario</param-value>
</context-param>
<context-param>
<param-name>jdbc_password</param-name>
<param-value>senha</param-value>
</context-param>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
formlogin.html
</welcome-file>
</welcome-file-list>
</web-app>
A pergunta é. Qual o parâmetro que devo utilizar em <param-name>jdbc_driver</param-name> ???
Grato.
Wallfox
oracle.jdbc.driver.OracleDriver
Olá jairelton
Fix meu web.xml assim:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>jdbc_driver</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</context-param>
<context-param>
<param-name>jdbc_url</param-name>
<param-value>jdbc:oracle:thin:hr/hr@localhost:1521/XE</param-value>
</context-param>
<context-param>
<param-name>jdbc_user</param-name>
<param-value>system</param-value>
</context-param>
<context-param>
<param-name>jdbc_password</param-name>
<param-value>senha</param-value>
</context-param>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
Estou recebendo a seguinte mensagem de erro:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Problemas com a consulta ao BD!
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.index_jsp._jspService(index_jsp.java:109)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
java.lang.Exception: Problemas com a consulta ao BD!
org.apache.jsp.index_jsp._jspService(index_jsp.java:95)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
O que estou fazendo errado??? O meu banco está rodando direitinho e para teste eu utilizo o Squirel com esta jdbc_url e tudo OK.
Grato.
Wallfox