Hi, I have a Sun Microsystems machine, on this machine a .jsp page that
inovkes a servlet called InsContactenos, when the page call the servlet it
returns an error.  I dont know wht must be happening, any one of you can
help me? In previos messages i received your help and it worked fine!!! now
I need some help again.  Thanks in advance,  the log looks like this:

[14/Feb/2001:15:23:01] info (  887): Internal Info: loading servlet
/institucional_contactenos.jsp
[14/Feb/2001:15:23:16] info (  887): Internal Info: loading servlet
/contactenos.jsp
[14/Feb/2001:15:23:30] info (  887): Internal Info: loading servlet
/servlet/InsContactenos
[14/Feb/2001:15:23:30] info (  887): /servlet/InsContactenos: init
[14/Feb/2001:15:23:30] failure (  887): Internal error: exception thrown
from the servlet service function (uri=/servlet/InsContactenos):
java.lang.NullPointerException, Stack: java.lang.NullPointerException
        at InsContactenos.cleanUp(InsContactenos.java:51)
        at InsContactenos.doPost(InsContactenos.java:39)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)
        at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
a:497)


This is the page:


<table>
  Aca se Ingresan los Datos Nuevos
  <Form Method="Post" ACTION="/servlet/InsContactenos">
    <Input Type="Text" Id="Fecha_Recibo" Name="Fecha_Recibo">
    <Input Type="Text" Id="Email_Origen" Name="Email_Origen">
    <Input Type="Text" Id="Destinatario" Name="Destinatario">
    <Input Type="Text" Id="Asunto" Name="Asunto">
    <Input Type="Text" Id="Cc" Name="Cc">
    <Input Type="Text" Id="Texto" Name="Texto">
    <Input Type="Submit">
  </Form>
</table>



This is the servlet:



import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;

public class InsContactenos extends HttpServlet{


protected String dbURL = "jdbc:odbc:orclx07";
protected String dbuserID = "xxx";
protected String dbpasswd = "xxx";
protected Connection dbConnection;
protected PreparedStatement stmt;

public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
        {

        try{
        String Fecha_Recibo = req.getParameter("Fecha_Recibo");
        String Email_Origen = req.getParameter("Email_Origen");
        String Destinatario = req.getParameter("Destinatario");
        String Asunto = req.getParameter("Asunto");
        String Cc = req.getParameter("Cc");
        String Texto = req.getParameter("Texto");

        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        dbConnection =
DriverManager.getConnection("jdbc:oracle:oci:solutech/solutech@orclx07");

        Statement stmt = dbConnection.createStatement();

        String sql= "INSERT INTO bdct_conepros (FECHRECI, EMAILORIG,
EMAILDEST, ASUNCONE, COPICONE,  DATAMENS, FECHRESP, DATARESP) VALUES ('" +
Fecha_Recibo + "', '" + Email_Origen +"', '" +  Destinatario + "', '" +
Asunto + "', '" + Cc + "','" + Texto + "', ' ', ' ', ' '";

        ResultSet rs = stmt.executeQuery(sql);
        stmt.close();
        dbConnection.close();
        }
        catch (Exception e)
        {
            cleanUp();
            e.printStackTrace();
        }


        }


    public void cleanUp()
    {
        try {
            System.out.println("Closing database connection");
            dbConnection.close();
        }
        catch (SQLException e)
        {
            e.printStackTrace();
        }
    }


}



__________________________
Mauricio A. Villa
Microsoft Certified Professional
Development Department
Solutech e-Business
(574) 3120019 Ext. 13
[EMAIL PROTECTED]
www.solutech.com.co

___________________________________________________________________________
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