From: Ahmet Gune? [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 29 January 2000 0:54
>I have been trying to solve two problems related to JDBC
>connection from Servlets:

>1. Why LIKE statement does not work?
>        I am trying to execute a SQL statement like this:
>        SQL = "SELECT * FROM Customers WHERE firstname LIKE \"A*\"";
>        rst = stmt.executeQuery(SQL);
Try using a '%' as the wildcard instead of '*'. I believe that '%' is the standard 
wildcard for SQL.

>2. How can I insert into a database that has date/time fields.
>       I tried every possibility
>       that we use in Access, but none of them worked.
Try using # to delimit the date instead of single or double quotes. I usually use 
dates of the form
        #17 January 2000 11:59:00#
or
        #17-January 2000 11:59:00#
to avoid any confusion over date first or month first. eg. is this 1 December or 12 
January...
        #12/1/2000#

Using JDBC to ODBC to MS Access data file I find this works quite well
cheers,
kev

EOM

NOTICE - This message contains information intended only for the use of the addressee 
named above.  It may also be confidential and/or privileged.  If you are not the 
intended recipient of this message you are hereby notified that you must not 
disseminate, copy or take any action in reliance on it.  If you have received this 
message in error please notify [EMAIL PROTECTED]

___________________________________________________________________________
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