Contents
In-Memory Database
Intermission
Generated Columns
The OFFSET/FETCH Syntax
SQL Roles
For More Information
The next major release of Java DB, version 10.5.1.1, is now available for download. Java DB is Sun`s supported distribution of the Apache Derby open-source database. Java DB is 100 percent Java technology and easy to use. Don`t be fooled by its small JAR file (2.5M): This free database is fast, reliable, and packed with features. You can learn more about it on the Java DB web site.
The new 10.5.1.1 release of Java DB introduces performance boosts and some exciting features:
Scalability. Throughput has gone up significantly for applications that concurrently read and update indexed tables.
Large Objects (LOBs). Large binary and text objects stream faster.
In-Memory Database. Fast, transient databases can live entirely in memory and vanish when the Java Virtual Machine (JVM)* exits.
Generated Columns. Queries run faster because query fragments can be indexed.
OFFSET/FETCH. Results can be chunked efficiently.
SQL Roles. Fine-grained access control is simpler.
The rest of this article describes the new features: in-memory database, generated columns, OFFSET/FETCH syntax, and SQL roles.
In-Memory Database
Version 10.5.1.1 introduces in-memory databases. Now you can run fast queries against complicated data that disappears when your JVM exits. In-memory databases are great for the following:
Caches. Use in-memory Java DB in the middle tier to cache data from enterprise back ends.
Monitors. Use in-memory Java DB to aggregate and analyze transient streams of sensor and environmental data.
Test rigs. Use in-memory Java DB to plug into test rigs so that laptops can test enterprise applications fast.
Creating an in-memory database is easy. Just add the memory subprotocol to the JDBC connection URL. For instance, if your classpath contains the Derby JAR file (derby.jar), here`s how you create a JDBC connection to an in-memory database called patient:
java.sql.Connection conn = java.sql.DriverManager.getConnection( "jdbc:derby:memory:patient;create=true" );
After that, you use the in-memory patient database just like you would a disk-based database: Create tables, views, triggers, functions, and procedures. Insert, update, browse, and delete data. When your application exits, the database disappears, leaving no trace of itself on disk.
The in-memory database is an experimental feature in version 10.5.1.1. This means that the API may change when it is fully productized in the next major release. Try the new release and let the Java DB development team know how to improve it. The best way to reach the team is through the Derby community mailing list, specifically derby-user [at] db.apache.org.
Intermission
Before turning to the other major features in version 10.5.1.1, let`s set up Java DB for the examples that this article will show. These examples use a medical research application. In this application, data is collected on patients participating in a study. Because these are just examples, you take two shortcuts. First, you use a transient in-memory database so that you don`t have to clean up when you are done.
Second, you use Java DB`s BUILTIN authentication scheme. The BUILTIN authentication scheme is useful for writing tests like this, but you should not use this scheme in production. To run an application like this in production, use an on-disk database and plug in an LDAP-based authenticator as described in the white paper on Java DB security.
To run these examples, download version 10.5.1.1 of the Java DB engine and tools. Make sure that you wire the derby.jar and derbytools.jar files into your classpath.
Source:
http://java.sun.com/developer/technicalArticles/Database/javadb_10_5/index.html
In-Memory Database
Intermission
Generated Columns
The OFFSET/FETCH Syntax
SQL Roles
For More Information
The next major release of Java DB, version 10.5.1.1, is now available for download. Java DB is Sun`s supported distribution of the Apache Derby open-source database. Java DB is 100 percent Java technology and easy to use. Don`t be fooled by its small JAR file (2.5M): This free database is fast, reliable, and packed with features. You can learn more about it on the Java DB web site.
The new 10.5.1.1 release of Java DB introduces performance boosts and some exciting features:
Scalability. Throughput has gone up significantly for applications that concurrently read and update indexed tables.
Large Objects (LOBs). Large binary and text objects stream faster.
In-Memory Database. Fast, transient databases can live entirely in memory and vanish when the Java Virtual Machine (JVM)* exits.
Generated Columns. Queries run faster because query fragments can be indexed.
OFFSET/FETCH. Results can be chunked efficiently.
SQL Roles. Fine-grained access control is simpler.
The rest of this article describes the new features: in-memory database, generated columns, OFFSET/FETCH syntax, and SQL roles.
In-Memory Database
Version 10.5.1.1 introduces in-memory databases. Now you can run fast queries against complicated data that disappears when your JVM exits. In-memory databases are great for the following:
Caches. Use in-memory Java DB in the middle tier to cache data from enterprise back ends.
Monitors. Use in-memory Java DB to aggregate and analyze transient streams of sensor and environmental data.
Test rigs. Use in-memory Java DB to plug into test rigs so that laptops can test enterprise applications fast.
Creating an in-memory database is easy. Just add the memory subprotocol to the JDBC connection URL. For instance, if your classpath contains the Derby JAR file (derby.jar), here`s how you create a JDBC connection to an in-memory database called patient:
java.sql.Connection conn = java.sql.DriverManager.getConnection( "jdbc:derby:memory:patient;create=true" );
After that, you use the in-memory patient database just like you would a disk-based database: Create tables, views, triggers, functions, and procedures. Insert, update, browse, and delete data. When your application exits, the database disappears, leaving no trace of itself on disk.
The in-memory database is an experimental feature in version 10.5.1.1. This means that the API may change when it is fully productized in the next major release. Try the new release and let the Java DB development team know how to improve it. The best way to reach the team is through the Derby community mailing list, specifically derby-user [at] db.apache.org.
Intermission
Before turning to the other major features in version 10.5.1.1, let`s set up Java DB for the examples that this article will show. These examples use a medical research application. In this application, data is collected on patients participating in a study. Because these are just examples, you take two shortcuts. First, you use a transient in-memory database so that you don`t have to clean up when you are done.
Second, you use Java DB`s BUILTIN authentication scheme. The BUILTIN authentication scheme is useful for writing tests like this, but you should not use this scheme in production. To run an application like this in production, use an on-disk database and plug in an LDAP-based authenticator as described in the white paper on Java DB security.
To run these examples, download version 10.5.1.1 of the Java DB engine and tools. Make sure that you wire the derby.jar and derbytools.jar files into your classpath.
Source:
http://java.sun.com/developer/technicalArticles/Database/javadb_10_5/index.html
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Java community to read.
Most Popular News
-
How to stand out from other Java/JEE Professionals?
Published about 14-01-2009 | Rated +3 -
10 reasons IT certification will be important in 2009
Published about 05-01-2009 | Rated +2 -
The 9 hottest skills for `09
Published about 02-01-2009 | Rated +1 -
New Features in Servlets 3.0
Published about 05-01-2009 | Rated +4
Most Recent User Submitted News
- JDBC DEMO
Submitted by ATUL | Rated +2 - Writing Your own Twitter Application Using Java, Swing, and Twitter4j
Published about 20-08-2009 | Rated 0 - Cloud computing...
Submitted by Mahi | Rated 0 - JRebel 2.1 released - Strolling with Struts
Published about 06-10-2009 | Rated 0







