I defined a database using Access in my C drive. When I test my code the message I get is: database not found java.sql.SQL Exception:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The code that seems to be causing the problem is somewhere in the following:
I have tested the above code using another database created in my C drive and there are no error messages. What does the error message mean? And what am I doing wrong? I am trying to work out the bugs in preparation for a school project. My java course is finished and the teacher has moved out of the country and the other students are unvailable for help.
Code:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class register3 extends HttpServlet {
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out=res.getWriter();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:CostConnection","","");