Sir,
   I have gone through the book JSP (O'REILLY)....and
in chapter 9 page no. 169 i happened to use the
<ora:sqlUpdate>
tag with an insert query ...where in i want to extract
the system date and time and put it into database
.....i am using MS ACCESS
as my database.....<ora:sqlTimestampValue value="<%=
new java.util.Date() %>" /> for extarcting system time
also dosen't work at my place...
it gives error "syntax error in INSERT INTO
query".......the system date (day,month,year) which i
require in my project is not passed as parameter from
an html form...
but it has to be extracetd from the system date......
i have tried the following..can u please correct
me......:(here my database has date and time set to
type DATE/TIME)

================================================================================================

<%@ page language="java" %>
<%@ page import="com.ora.jsp.sql.*,
java.util.Calendar" %>
<%@ taglib uri="/orataglib" prefix="ora" %>

<ora:validateSession name="validUser"
      loginPage="login.jsp" errorMsg="Please log in
first." />

<% Calendar calendar = Calendar.getInstance();
   String date =  calendar.get(Calendar.DATE) +"-" +
calendar.get(Calendar.MONTH)+"-"+calendar.get(Calendar.YEAR);
%>
<% String amtval = request.getParameter("amount") ;%>
<% int amount = Integer.parseInt(amtval) ; %>
<ora:useDataSource id="atm"
className="sun.jdbc.odbc.JdbcOdbcDriver"
                   url="jdbc:odbc:atm" />

<ora:sqlUpdate dataSource="atm" >
  INSERT INTO deposit
(cardno,amount,date,time)
  VALUES(?, ?, ?,? )
<ora:sqlStringValue param="cardno" />
<ora:sqlStringValue param="amount" />
<ora:sqlStringValue param="date" />
<ora:sqlTimestampValue value="<%= new java.util.Date()
%>" />
</ora:sqlUpdate>

=================================================================================================

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to