What does JDBC escape syntax do?

What does JDBC escape syntax do?

Post by Shayne Batema » Wed, 20 Jan 1999 04:00:00



I've noticed that java.sql.Date.toString() says, "Format a date in JDBC
date escape format."  What is that and how does it work?  I couldn't
find any docs explaining it.

All help is Appreciated
Shayne

 
 
 

What does JDBC escape syntax do?

Post by Klaus Gotthard » Thu, 21 Jan 1999 04:00:00



> I've noticed that java.sql.Date.toString() says, "Format a date in JDBC
> date escape format."  What is that and how does it work?  I couldn't
> find any docs explaining it.

> All help is Appreciated
> Shayne

from the jdbc-guide:

 d, t, and ts for date and time literals
DBMSs differ in the syntax they use for date, time, and timestamp
liter-als.
JDBC supports ISO standard format for the syntax of these literals,
using
an escape clause that the driver must translate to the DBMS
representation.
For example, a date is specified in a JDBC SQL statement with the
fol-lowing
syntax:
{d yyyy-mm-dd}
In this syntax, yyyy is the year, mm is the month, and dd is the day.
The
driver will replace the escape clause with the equivalent DBMS-specific
rep-resentation.
For example, the driver might replace {d 1999-02-28} with '28-
FEB-99' if that is the appropriate format for the underlying database.
There are analogous escape clauses for TIME and TIMESTAMP:
{t hh:mm:ss}
{ts yyyy-mm-dd hh:mm:ss.f . . .}
The fractional seconds (.f . . .) portion of the TIMESTAMP can be
omit-ted.

--
Klaus Gotthardt,
Johann Wolfgang Goethe-Universit?t,Verwaltungsdatenverarbeitung

Tel:+49 (0)69-798-23380
Fax:+49 (0)69-798-23381
pgp-key: http://www.rz.uni-frankfurt.de/~gotthard/KLAUS_GOTTHARDT.PGP

 
 
 

1. ADO thinks DBMS is done, but DBMS ain't done

I have 2 Recordsets on 2 different applications communicating with the same
database

-=The first Recordset is opened with=-
m_pGlobal_RS->Open(adCmd, m_pConnection.GetInterfacePtr(), adOpenKeyset,
adLockPessimistic, adCmdText);

-=The second Recordset is opened with=-
local_RS->Open(adCmd, m_pConnection.GetInterfacePtr(), adOpenKeyset,
adLockReadOnly, adCmdText);

* adCmd is a simple SELECT statement that is the SAME for both recordsets.

The code order is roughly this

Open m_pGlobal_RS
...
...
Change fields on m_pGlobal_RS
...
...
MoveNext on all rows of m_pGlobal_RS until EOF then MoveFirst  // since
pessimistic every row op sends update
..
..
I then fire an event to another application which opens local_RS.

It is random whether the data opened by the second RS is the pre-update data
or the post-update data. How can this be? I opened the connection
with the default  synchronous option, isn't this asynchronous behavior?

Thanks for the help,
-=Adog

2. Money vs Decimal

3. Trigger doing UNLOAD to file OR calling Store Procedure doing the UNLOAD to file

4. Access 2000, upgrade or not?

5. Caché from InterSystems - doing wh at other MV vendors should be doing

6. how to store pdf files in sql 6.5?

7. WHERE Syntax Help (can this be done)

8. Damaged Files. Why?

9. Can this be done in SQL syntax?

10. inserting "{" value and jdbc escape syntax

11. inserting "{" character and jdbc Escape Syntax

12. JDBC Escape Syntax for dates??