Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2007

Tip: Looking for answers? Try searching our database.

JDBC literals

Thread view: 
Roedy Green - 01 Sep 2007 10:48 GMT
I have composed a table of JDBC literals.  It may contain errors or be
incomplete. Please have a look and pass on improvements.

See http://mindprod.com/jgloss/jdbc.html#LITERALS
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Arne Vajhøj - 01 Sep 2007 23:22 GMT
> I have composed a table of JDBC literals.  It may contain errors or be
> incomplete. Please have a look and pass on improvements.
>
> See http://mindprod.com/jgloss/jdbc.html#LITERALS

I think this stuff is either not needed when using
PreparedStatement or very rarely used.

The most important capability in JDBC of this type is
the functions.

Section 11.4 in
http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec/jdbc-spec.frame11.html !

Arne
Roedy Green - 02 Sep 2007 03:11 GMT
>I think this stuff is either not needed when using
>PreparedStatement or very rarely used.

but you do need literals to introduce simple constants into Prepared
statements.

It is funny.  I did quite a long search, but came up with no
definitive table.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 02 Sep 2007 04:03 GMT
>The most important capability in JDBC of this type is
>the functions.

I have done a first cut at a table of function. They need to be
fleshed out with details mostly about 0- or 1-basedness.

see http://mindprod.com/jgloss/jbdc.htm#FUNCTIONS
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 02 Sep 2007 05:53 GMT
On Sun, 02 Sep 2007 03:03:21 GMT, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>I have done a first cut at a table of function. They need to be
>fleshed out with details mostly about 0- or 1-basedness.

Function table is now pretty well complete.  There is an amazing
amount of crap documentation on the Internet of the functions, from
some famous companies.  The definitive info is a PDF document you can
download from Sun.  See http://mindprod.com/jgloss/jdbc.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 02 Sep 2007 06:18 GMT
On Sat, 01 Sep 2007 09:48:55 GMT, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>I have composed a table of JDBC literals.  It may contain errors or be
>incomplete. Please have a look and pass on improvements.
>
>See http://mindprod.com/jgloss/jdbc.html#LITERALS

the one remaining puzzle is how do you specify a long numeric literal
in SQL.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Lee Fesperman - 04 Sep 2007 09:21 GMT
> On Sat, 01 Sep 2007 09:48:55 GMT, Roedy Green
> <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
[quoted text clipped - 7 lines]
>  the one remaining puzzle is how do you specify a long numeric literal
> in SQL.

SQL92 doesn't have a specific literal for long, or int for that
matter. Integers and decimals are covered by 'exact numeric literal':

 digits [ . [ digits ] ]  | . digits

There is no specified limit on the number of digits.

Alternatively, you can use prepared statements (as suggested) or:

 {fn convert('10',SQL_BIGINT)}

Other suggestions for the Literals section:

+ SQL92 only specifies using single quotes for delimiting string, with
two single quotes to indicate embedded quotes. Double-quotes are
reserved for quoting names. This is not true for all SQL DBMS vendors,
though.

+ Timestamp literals have an optional fraction for seconds - [.f...].

Suggestions for the Functions section:

+ The 3rd argument for LOCATE is optional.

+ TIMESTAMPADD and TIMESTAMPDIFF have a first argument (interval) that
the form - SQL_TSI_XXXX. Where XXXX is YEAR, DAY, SECOND, ... It
specifies the interval being used in the calculation.

+ The second argument for CONVERT is prefixed with SQL_.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.firstsql.com)
Roedy Green - 04 Sep 2007 10:45 GMT
On Tue, 04 Sep 2007 01:21:12 -0700, Lee Fesperman
<firstsql@ix.netcom.com> wrote, quoted or indirectly quoted someone
who said :

>Other suggestions for the Literals section:

Thanks Lee. Your suggestions are now incorporated.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.