>From: "Andr�s Aguiar" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: RE: 500 Internal server/Servlet-JDBC
>Date: Mon, 16 Aug 1999 15:18:27 +0200
>
>You can set up 2 kinds of ODBC Data sources in NT. 'User DSN' or 'System
>DSN'. The 'User DSN's are available to your Java applications, but probably
>not to the Servlet Engine if it's running as a NT Service. To use a ODBC
>data source from a NT Service, y have to define it as a System DSN (see in
>the ODBC Data Source Administrator in the Control Panel).
>
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's
> > Java Servlet
> > API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of V C
> > Sent: Sunday, August 15, 1999 11:22 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: 500 Internal server/Servlet-JDBC
> >
> >
> > 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/jdb
> > c: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
>
>
_______________________________________________________________
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