Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> inserting java.sql.date into a oracle 8i table

inserting java.sql.date into a oracle 8i table

From: Adam C. <u_acarbone_at_umassd.edu>
Date: 2000/04/27
Message-ID: <3908f30d@addressworks2.umassd.edu>#1/1

I was wondering if any one can help me I am trying to insert a date into an oracle table from a servlet. This is the code I am using sqlMesDate = new java.sql.Date(System.currentTimeMillis());

String query = "INSERT INTO MessageBoard VALUES ('" + subject + "','" + name + "','" + email + "'," + sqlMesDate + ",'" + message + "')" ;

try
{

Connection dbConnection = tools.getDatabaseConnection(); Statement statement = dbConnection.createStatement();

result = statement.executeUpdate(query); dbConnection.close();
}catch (SQLException sqle)
{

out.println(tools.getHtml("DatabaseError.htm"));
out.println("<BR>" + sqle);
out.close();

}

this is the error I get
java.sql.SQLException: ORA-00932: inconsistent datatypes Received on Thu Apr 27 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US