FirstSQL/J is an Object-Relational Database Management System (ORDBMS) written fully in Java. It provides intermediate level support to the SQL-92 standard and full Java object capabilities in the physical database using Java classes. SQL is the data access language and Java Database Connectivity (JDBC) is used as the client interface. In addition to the primitive data types, columns of the database can map to Java Objects. Moreover, stored procedures written in Java can be called by JDBC. Application developers can combine the their database and application code into a single .jar file and execute on any device, embedded system, or server computing platform with a Java Virtual Machine.
The development of FirstSQL/J started in 2001. The first publicly available version, FirstSQL/J v1.0, was released in February 2002. The initial release came in two versions: the Enterprise version to be used by client/server applications and the professional version to be used by embedded desktop applications. FirstSQL/J has since been undergoing continuous development and support. In addition to the original Enterprise and Professional versions, versions to be used for embedded mobile systems and Android devices were released in October 2005 and October 2015, respectively.
Custom API SQL Stored Procedures Command-line / Shell
All data access to the physical database is through SQL. However, the FirstSQL/J client interface support both SQL and Java (through JDBC). The client application may use Java code to make SQL queries or call Stored Procedure for retrieving data. The tool Ijdbc allows SQL statements to be executed by through the command-line.
Views are stored underneath as trees of database elements. The supported clauses include GROUP, UNION, and WITH CHECK OPTION as specified in the SQL92 standard. Views can be created by interactive SQL tools called Ijdbc and IjdbcWin, provided as part of the database.
Two-Phase Locking (Deadlock Detection)
Transactions in FirstSQL/J are implemented using Java Transaction API (JTA), which gives each transaction a timeout. Upon reaching timeout, the transaction is aborted and all previous changes done by the transaction are rolled back.
A rolling log is maintained by the primary server used to record the status of transactions. Replication servers are read-only servers which are copies of the primary server. When a transaction is committed, the primary server sends all changes to replication servers. A special type of replication server is called Standby Server. When a Standby Server detects that a primary server has failed, it switches to read-write mode to continue processing transactions.
Decomposition Storage Model (Columnar)
All user data is stored as column values in tables.
Read Uncommitted Read Committed Serializable Repeatable Read
Transactions in FirstSQL/J are supported using Java Transaction API. All four standard isolation levels supported by JDBC are supported by FirstSQL/J. The default transaction isolation level is Repeatable Read.
Query execution is done by JDBC.
Stored Procedures need to be written in Java. They can be called directly using SQL commands or by other Java code in the client application. DDL commands catalog Java classes in the database. Once cataloged, the class methods can be called as Stored Procedures.
Main Memory mode and conventional Disk mode are supported. The two modes cannot be used simultaneously. The physical database either reside in main memory or disk. Disk mode persists data at runtime whereas Main Memory mode persists data between runs.
When a transaction is committed, the primary server sends all committed changes to read-only replication servers. When the primary server fails, one of the replication servers switch to read-write mode and continue serving transactions.
The supported SQL foreign key features are cascaded Update and Delete, Self-referencing and Cross-referencing as part of the SQL-92 standard.
Columns can map to Java Objects. Java classes, methods, and inheritance are fully supported in the physical database. They can be managed using JDBC client APIs and accessed using SQL.
The system architecture depends on the configuration being used. In FirstSQL/J Professional Edition, the client application and the DBMS run on the same Java Virtual Machine and thereby the same physical machine. All data is embedded to the DBMS engine. In FirstSQL/J Enterprise Edition, the client application and the DBMS engine run on different Java Virtual Machines and physical machines. The JVM running the DBMS engine is responsible for both execution and storage. In addition to a single primary server, there can be many replication servers. Replication servers are standalone read-only servers that mirror the primary server.
Query commands support of a mixture of SQL and Java methods. JIT Compilation is used by the Java Virtual Machine.
Database elements are stored in the form of trees. A tree can be constructed from a single table or a join of tables in the database.