db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "VersionInfo" by JohnHEmbretsen
Date Tue, 23 Oct 2007 15:10:35 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by JohnHEmbretsen:
http://wiki.apache.org/db-derby/VersionInfo

The comment on the change is:
Added database format version info

------------------------------------------------------------------------------
  
  '''Table of Contents'''
  [[TableOfContents(3)]]
+ 
+ == Derby database format version ==
+ 
+ The Derby database format may change between Derby feature releases (for example 10.1.x
-> 10.2.x -> 10.3.x), but will (most likely) not change between releases of the same
branch (for example 10.2.1.6 -> 10.2.2.0). Thus, the database format version number will
be either 10.0, 10.1, 10.2 or 10.3, etc.
+ 
+ '''Possible scenario:''' You want to start using some great new feature in the latest Derby
release against your existing database, so you need to do a so-called "hard upgrade" of the
database. You are not quite sure which version of Derby you were using when you created the
database, which may be useful to know before upgrading.
+ 
+ '''Possible solution (1):''' Read the database property {{{DataDictionaryVersion}}} when
connected to the database using the most recent JDBC driver version available to you.
+ 
+ '''Example:''' Use IJ and the embedded driver from 10.3.1.4 to connect to your database
('tenOneThreeOne', created with the 10.1.3.1 release) and retrieve the version number:
+ {{{
+ $ java -jar /opt/derby/10.3.1.4/lib/derbyrun.jar ij 
+ ij version 10.3
+ ij> connect 'jdbc:derby:tenOneThreeOne';
+ ij> values syscs_util.syscs_get_database_property( 'DataDictionaryVersion' );
+ 1
+ ------------------------------------------------------------------------------
+ 10.1
+ }}}
+ 
+ Note that this property is not a documented part of Derby's api, so this could change in
a future release.
+ 
+ 
+ '''Possible solution (2):''' Try connecting to the database using the oldest JDBC driver
available to you. If the database format is newer and incompatible, an SQLException (or ij
error) will be thrown, detailing the version of the database format.
+ 
+ '''Example:''' Use IJ and the embedded driver from 10.0.2.1 to attempt a connection to your
(hopefully newer) database.
+ {{{
+ $ java -cp /opt/derby/10.0.2.1/lib/derby.jar:/opt/derby/10.0.2.1/lib/derbytools.jar org.apache.derby.tools.ij
+ ij version 10.0
+ ij> connect 'jdbc:derby:tenThreeOneFour';
+ ERROR XJ040: Failed to start database 'tenThreeOneFour', see the next exception for details.
+ ERROR XSLAN: Database at /opt/derby/databases/tenThreeOneFour has an incompatible format
with the current version of the software.  The database was created by or upgraded by version
10.3.
+ }}}
+ ----
  
  == Derby jar file version (sysinfo) ==
  

Mime
View raw message