Does Kodo require a database to function?
Kodo does require an existing database against which to operate. However, Kodo ships with a small, open-source, pure-java database called Hypersonic that can be used for development without requiring an existing database installation.
What databases does Kodo support?
Kodo has built-in support for all the major databases, including Oracle, Microsoft SQL Server, Sybase, and Informix. In addition, Kodo provides APIs that allow the developer to adapt Kodo to work with any other database that provides a JDBC-compiant driver. A full list of the supported databases can be found at Appendix B, Supported Databases.
What additional software do I need to use Kodo with my database?
Kodo requires Java Development Kit version 1.2.2 or higher. Additionally, if you will be accessing a database other than Hypersonic, Kodo requires a JDBC driver that can communicate with your database. All other libraries needed by Kodo are provided in the Kodo distribution. A list of all the libraries that Kodo requires and uses can be found at Appendix G, Development and Runtime Libraries.
Where can I find the JDBC driver for my application?
JDBC drivers are typically obtained from the database vendor's web site. In addition, there are many third-party companies that provide JDBC drivers for various databases. For a comprehensive list of existing JDBC drivers, see the Sun JDBC driver database at: http://servlet.java.sun.com/products/jdbc/drivers.
What is the best JDBC driver to use for my application?
SolarMetric does not usually endorse any specific JDBC driver for a particluar database. Provided the driver is truly JDBC compliant, it should work with Kodo without problems. Typically it is a good idea to first look at the JDBC driver that your database vendor provides, since these are often high-quality and free. An advantage of the transparent JDO API is that you can simply "drop in" a different JDBC driver version and change a few properties, and you can test your application without changing any code. This makes the process of profiling your application's performance with different JDBC drivers a very simple task.
What version of JDBC does Kodo use?
Kodo utilizes version 2.0 of the JDBC specification, and requires that a driver be JDBC 2.0 compliant. In addition, Kodo uses the JDBC 2 Standard Extensions, which are provided in the Kodo distribution.
Can Kodo integrate with a legacy database schema?
Certainly. Kodo provides a very flexible set of mapping options to be able to integrate your Java object model with almost any relational database schema. In addition, Kodo provides extensible APIs that allow the developer to create their own mappings for those non-standard relational constructs that may not be included with Kodo "out of the box". Furthermore, Kodo provides a reverse mapping tool, which allows developers to automatically generate a Java object model from an existing schema, which dramatically reduces the amount of time the developer needs to spend manually setting up the mappings. To get started with the reverse mapping tool, see Chapter 3, Reverse Mapping Tool Tutorial.
I am desigining a persistent model from scratch and don't want to deal with creating a database schema. Can Kodo generate a schema for me?
Yes. Kodo allows you to design your application in a object-centric fashion, and can automatically generate a consistent relational schema from your object model. This is ideal for developers who are designing a new application that does not need to integrate with an existing schema. See Section 7.1, “Mapping Tool”.
I have both an existing object model and an existing database schema. Can I use Kodo without making changes to either?
Probably. Kodo's mapping capabilities are quite flexible, and the Kodo mapping tools provide facilities to deal with this "meet-in-the-middle" scenario. See Section 7.1.1, “Using the Mapping Tool” for a more detailed description.
Can Kodo generate the DDL for my database?
Yes. Kodo can either issue the DDL directly in order to create or update your database, or it can create a SQL script file. This can be done from the command line or using Ant. See Section 7.1.2, “Generating DDL SQL” for examples.
Can a Kodo run against multiple databases?
Yes. Kodo can operate simultaneously against an arbitrary number of databases at the same time. Utilizing XA transactions, you can even ensure transactional consistency across a hetergeneous set of databases when using container managed transactions.
Is there any limit to the number of rows Kodo can handle?
There is no limit to the size of table against Kodo can operate, nor is there any limit to the number of tables in the database. Kodo is used in applications that use databases ranging from just a few tables, to databases that have thousands of tables with millions or rows.
Can Kodo work with foreign keys?
Kodo can work with both deferred and non-deferred constraints. With non-deferred constraints, Kodo can be configured to analyze foreign key dependencies before executing SQL. With deferrable constraints, you should either make deferred the default or extend the DBDictionary to set deferred as the default for every connection. To enable Kodo's foreign key analysis, see Section 2.6.50, “kodo.jdbc.ForeignKeyConstraints”.
How can I change what schema Kodo is using?
Kodo can be configured to look at a subset of schemas, assign a default schema to mapping information, and to ignore the schema altogether. The first is controlled by the Section 2.6.56, “kodo.jdbc.Schemas” option which enumerates the schemas to analyze. The other options are configured at the DBDictionary level using the UseSchemaName and DefaultSchemaName properties (see Section 4.3, “Database Support”).
What do I have to do when using an external datasource?
While Kodo can handle external data sources, there are certain additional configuration options to be aware of. If your external data source automatically integrates with the global transaction (such as XA data sources), you should ensure that Kodo has access to a non-transactional datasource: Section 4.2.1, “Enlisted Data Sources”
How has Schema Tool changed since version 2.x?
Schema Tool has been redesigned to only manage the schema through XML representations of the schema. Mapping Tool now manages the mapping between your classes and database. Mapping Tool can optionally use Schema Tool to synchronize the database schema to create any missing database objects. For further information on Mapping Tool, see Section 7.1, “Mapping Tool”.