0

this is my problem
my jsp page is

<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:truth","sa","");
Statement st=con.createStatement();
String cate=request.getParameter("T3");
String user=request.getParameter("user");
String pass=request.getParameter("passwd");
String reenter=request.getParameter("rpasswd");
String mail=request.getParameter("mail");
String credit=request.getParameter("credit");
String address=request.getParameter("add");
String city=request.getParameter("city");
String state=request.getParameter("state");
String country=request.getParameter("country");
String mobile=request.getParameter("mobile");
out.println(user+pass+mail+mobile+address+city+state+country);

st.executeUpdate("insert into usertable values('"+user+"','"+pass+"','"+mail+"','"+mobile+"','"+address+"','"+city+"','"+state+"','"+country+"')");
response.sendRedirect("Index.jsp");
%>

this page must give a result login page with details fetched from database sql server 2005
but it displays an error as below

i am using windows xp and apache tomcat 6.0 and sql server 2005
the odbc connections were connected to the database successfully

and i can get the data when the same program was written in java but i cant get in this jsp

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
	org.apache.jsp.Validation_jsp._jspService(Validation_jsp.java:82)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
	sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
	sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
	sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
	sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
	sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
	java.sql.DriverManager.getConnection(Unknown Source)
	java.sql.DriverManager.getConnection(Unknown Source)
	org.apache.jsp.Validation_jsp._jspService(Validation_jsp.java:59)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
Apache Tomcat/6.0.26

Edited by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jwenting
0

says it all, really. The specified database isn't there.

And -10000 points for using the jdbc-odbc bridge driver and MS Access in a distributed environment.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.