Now it is working after removing the Data Source Name in System DSN and
re-adding it.

Probably the old System DSN set up for this Data Source may be wrong!.

Still, I didin't understand how I could access the same database (i.e.,the
servlet is accessing)
in an application using the same driver with old System DSN set up.

I use Oracle8/NT.

Thanx



Sreenivasan Pradhip <[EMAIL PROTECTED]>
Monday August 16, 1999 11:52 AM

Please respond to "A mailing list for discussion about Sun Microsystem's Java
      Servlet API Technology." <[EMAIL PROTECTED]>
To:   [EMAIL PROTECTED]
cc:
Subject:  Re: [Re: 500 Internal server/Servlet-JDBC]




Hi
  i was just wondering what Server U use and the database...coz some of the
Servers are platform specific...and did U say U have been able to use it with
someother application...
V C <[EMAIL PROTECTED]> wrote:
Hi,
ODBC DSN is properly set up in WinNT. I could use the same URL and JDBC-ODBC
driver for accesiing the same database in application successfully!, but not
thru Servlet.

Thank you.




>From: Andr?s Aguiar <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: 500 Internal server/Servlet-JDBC
>Date: Sun, 15 Aug 1999 13:06:22 +0200
>
>Try to define your ODBC Data Source as a 'System DSN', not a 'User DSN'
>
>
>-----Original Message-----
>From: Venkata Kanugula <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>Date: Domingo 15 de Agosto de 1999 7:21
>Subject: 500 Internal server/Servlet-JDBC
>
>
> >Hi,
> >
> >I get a strange message when I run the following Servlet.
> >I am wondering how the same Servlet works fine in Win95, but not in NT.
> >Please help me.
> >
> >The message in the Web-server:
> >-----------------------------
> >JDBCServlet: init
> >java102.sql.SQLException: java.sql.SQLException: [Microsoft][ODBC Driver
>Manager] Data source name not found and no default driver specified
> >
> >
> >Servlet response:
> >-----------------
> >Error: 500
> >
> >Internal Servlet Error:
> >
> >java.lang.NullPointerException:
> >        at JDBCServlet.doGet(JDBCServlet.java:53)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> >        at
>com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
> >        at
>com.sun.web.core.InvokerServlet.service(InvokerServlet.java:169)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> >        at
>com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
> >        at com.sun.web.core.Context.handleRequest(Context.java:375)
> >        at
>com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:135)
> >
> >
> >The source:
> >-----------
> >import java102.sql.*;
> >import java.io.*;
> >import javax.servlet.*;
> >import javax.servlet.http.*;
> >
> >public class JDBCServlet extends HttpServlet
> >{
> >   private Connection conn;
> >
> >  public void init(ServletConfig conf) throws ServletException
> >  {
> >     super.init(conf);
> >
> >   try
> >   {
> >
> >     Class.forName("java102.sql.DriverSJ").newInstance();
> >     conn =
>DriverManager.getConnection("jdbc:socket://localhost:5588/jdbc:odbc:Tcp-loop
>back",
> >                               "scott","tiger");
> >
> >   }
> >   catch (ClassNotFoundException cnfe)
> >   {
> >      System.out.println(cnfe.getMessage());
> >   }
> >   catch (SQLException sqle)
> >   {
> >      System.out.println(sqle);
> >   }
> >   catch(InstantiationException ine)
> >   {
> >      System.out.println(ine);
> >   }
> >   catch(IllegalAccessException iae)
> >   {
> >      System.out.println(iae);
> >   }
> >  }
> >
> > public void doGet(HttpServletRequest req, HttpServletResponse res)
>throws
>ServletException
> > {
> >   int updresult;
> >   res.setContentType("text/html");
> >   req.getServerName();
> >   try
> >   {
> >     ServletOutputStream out = res.getOutputStream();
> >     out.println("<html>");
> >     out.println("<head>");
> >     out.println("<title> JBDC Servlet </title>");
> >     out.println("</head>");
> >     out.println("<body>");
> >
> >     Statement stmt = conn.createStatement();
> >     updresult = stmt.executeUpdate("update emp set ename = 'XXXXX' where
>ename = 'VIJAY'");
> >
> >     out.println("Row updated: " + updresult);
> >     out.println("</body>");
> >     out.println("</html>");
> >
> >   }
> >
> >   catch (SQLException sqle)
> >   {
> >     System.out.println(sqle);
> >   }
> >   catch (IOException ioe)
> >   {
> >     System.out.println(ioe);
> >   }
> > }
> >
> >  public void destroy()
> >  {
> >    try
> >    {
> >      conn.close();
> >    }
> >    catch(SQLException sqle)
> >    {
> >      System.out.println(sqle);
> >    }
> >
> >  }
> >
> > }
> >
> >
> >
> >Additional info:
> >----------------
> >(Line No: 53) Statement stmt = conn.createStatement();
> >
> >JSDK2.1/JDK1.2.2/WinNT/Netscape4.61/JDBC-ODBC Driver
> >
> >Note:
> >-----
> >The same program works fine in Win95 with same JDBC Driver and Web
>Server.
> >
> >
> >Thank you.
> >
>
>___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
>body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> >
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to