Skip to content

2020Media

Home Contact Us News Webmail
 

Newsflash

2020Media is offering full support for Joomla, Magento, SugarCRM on hosting packages
 
You are here: Home arrow Tools arrow Reference arrow Database Case Sensitivity Issues
Database Case Sensitivity Issues PDF Print E-mail

JDBC Case Sensitivity Issues


There are a number of issues surrounding getting JDBC to work with different databases.

The following is extracted from

"JDBC Database Access with Java" by Graham Hamilton & others from Sun
(Addison-Wesley ISDN 0-201-30995-5

"The standard in SQL is that keywords are not case sensitive, so, for example, the following SELECT statement can be written in various ways."
.... 
"Quoted material, however, is case sensitive: ".

"Requirements can vary from one DBMS to another when it comes to identifier names.  For example, some DBMSs require that column and table names be given exactly as they were created in the CREATE TABLE statement, while others do not."
.....
"The only sure way to make patterns database-independent is to discover the way identifiers are stored, (with DatabaseMetaData methods), and then use the appropiate case in identifier name patterns. DatabaseMetaData has several methods for determining whether identifier names are stored in the database as lowercase, mixed case or uppercase

  •  storesLowerCaseIdentifiers
  • storesLowerCaseQuotedIdentifiers
  • storesMixedCaseIdentifiers
  • storedMixedCaseQuotedIdentifiers
  • storesUpperCaseIdentifiers
  • storesUpperCaseQuotedIdentifiers
  • supportsMixedCaseIdentifiers
  • supportsMixedCaseQuotedIdentifiers

If the methods with QuotedIndentifiers in their names return true, they allow nonalphanumeric characters if those characters are enclosed in quotation marks."

I guess what this means is that to ensure compatibility across JDBC drivers the way to do it is to ensure that identifiers are all stored the same way (either upper or lower case, but not a mixture and not quoted) and then use functions to convert appropiately in the code.

 

Comments

Did you find this information useful? Let us have your feedback

 
< Prev   Next >
Advertisement

Domain Search

Preferred Extensions -
.com .co.uk
.net .org
.me .eu
Nominet Members
Nominet members since 1999
CentralNic Accredited Registrar
Accredited since 2001
Imperial Registrations Platinum Partner
ICANN Accredited
RIPE member
RIPE member since 2002
 
[+]
  • Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Increase font size
  • Decrease font size
  • Default font size