Sagewire Logo

JDBC literals

8 Message(s) by 3 Author(s) originally posted in java databases


From: Roedy Green Date:   Saturday, September 01, 2007
I have composed a table of JDBC literal s. It may contain errors or be
incomplete. Please have a look and pass on improvements.

See http://mindprod.com/jgloss/jdbc.html#LITERALS
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: =?ISO-8859-1?Q?Arne_Vajh=F8j?= Date:   Saturday, September 01, 2007
wrote in message:
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


From: Roedy Green Date:   Saturday, September 01, 2007
On Sat, 01 Sep 2007 18:22:01 -0400, Arne Vajhøj <arne@xxxxxxxxxxx>
wrote in message, quoted or indirectly quoted someone who said :

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



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

It is funny. I did quite a long search, but came up with no
definitive table.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: Roedy Green Date:   Saturday, September 01, 2007
On Sat, 01 Sep 2007 18:22:01 -0400, Arne Vajhøj <arne@xxxxxxxxxxx>
wrote in message, quoted or indirectly quoted someone who said :

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
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: Roedy Green Date:   Sunday, September 02, 2007
On Sun, 02 Sep 2007 03:03:21 GMT, Roedy Green
wrote in message, 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 document ation 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
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: Roedy Green Date:   Sunday, September 02, 2007
On Sat, 01 Sep 2007 09:48:55 GMT, Roedy Green
wrote in message, 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 .
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com


From: Lee Fesperman Date:   Tuesday, September 04, 2007
wrote in message:
On Sat, 01 Sep 2007 09:48:55 GMT, Roedy Green
wrote in message, 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.



SQL92 does not 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 isn't 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)


From: Roedy Green Date:   Tuesday, September 04, 2007
On Tue, 04 Sep 2007 01:21:12 -0700, Lee Fesperman
wrote in message, quoted or indirectly quoted someone
who said :

Other suggestions for the Literals section:



Thanks Lee. Your suggestions are now incorporated.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com



Next Message: record numbers


Blogs related to JDBC literals

Designing Performance-Optimized JDBC Applications (Entry for ...
Recognized as experts in database access standards such as ODBC, Java® JDBC®, and ADO/OLE DB, DataDirect Technologies has consistently been instrumental in the development of new database access standards specifications. ...

java interview questions
Database - JDBC (java.sql) Connecting to a Database This example uses the JDBC-ODBC bridge to connect to a database called ''mydatabase''. try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:mydatabase"; ...

Bind variables - The key to application performance
When you put together an SQL statement using Java, or VB, or whatever, you usually use an API for accessing the database; ADO in the case of VB, JDBC in the case of Java. All of these APIs have built-in support for bind variables, ...

hi i created a Jtable with a custom model-renderer-editor and i ...
(not in a class) I thought it was possible, but my Java knowledge is rather rusty. Hiya, can anyone please point me to good docs that. no in java everything must be class or inside class. show me how to setup jdbc connection in sjas? ...

Sun Certified Associate for the Java Platform, Standard Edition ...
Section 3: Java Implementation of Object-Oriented Concepts * Notes: code examples may use the 'new' operator. * Develop code that uses primitives, enumeration types, and object references, and recognize literals of these types. ...

Does anyone know why when I mark a class as serializable and I ...
is it someone here? yeah, i forget exactly where though. i think it’s in the database param ~google jdbc connection string port. http://www.googleityoumoron.com/?go=jdbc connection string port. ~literal google $1 ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional