thank you very much.

-----Message d'origine-----
De : paniny serou [mailto:[EMAIL PROTECTED]]
Envoyé : vendredi 30 mars 2001 12:19
À : [EMAIL PROTECTED]
Objet : Re: trouble with extracting system date!!!


insert into  database  this way :
String Query = "INSERT INTO ORG (ORG_ID, ORG_NAME,
ORG_DATE_CRE, ORG_DATE_MAJ) VALUES (SEQ_ID.NEXTVAL, '"
+ name + "', SYSDATE, SYSDATE)";


and extract it this way (if you use Oracle) from the
DB:

"select ORG_ID, ORG_NAME,
To_char(ORG_DATE_CRE,'DD/MM/YYYY') ORG_DATE_CRE,
To_char(ORG_DATE_MAJ,'DD/MM/YYYY') ORG_DATE_MAJ,
To_char(ORG_DATE_GEN,'DD/MM/YYYY') ORG_DATE_GEN from
org";

hope it helps,
PAniny

--- Mahale Amit <[EMAIL PROTECTED]> a écrit : >
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


___________________________________________________________
Do You Yahoo!? -- Pour dialoguer en direct avec vos amis,
Yahoo! Messenger : http://fr.messenger.yahoo.com

===========================================================================
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

===========================================================================
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