12.1 PointBase Micro EditionAmong all mobile databases, PointBase Micro (v4.5) has the best CLDC/MIDP support. It actually produces a SQL database on the MIDP platform. Point-Base provides a set of proprietary Lite APIs under the com.pointbase.me package to access its MIDP database. The PointBase Lite API is very similar to JDBC. The only thing a JDBC developer needs to know to get started is the URL to obtain a Connection object (Listing 12.1). Listing 12.1. Connect to a PointBase Micro MIDP database
The PointBase Micro Lite database has a footprint of 47 KB. In the Lite API's PreparedStatement and ResultSet classes, the setter and getter methods support only the following types: Int, String, Decimal, Date, and Bytes. The setBytes() and getBytes() methods allow us to manipulate binary database fields (i.e., Blob fields). You can use your camera phone to take pictures and store them in your on-device PointBase MIDP database! For more details, please refer to PointBase Micro documentation and sample applications (see "Resources").PointBase also provides a utility MIDlet, com.pointbase.me.tools. MicroConsoleMIDP. It allows developers to quickly peek into a database without writing a single line of access and UI code. The console has a simple UI to browse the content and schema of currently available tables. This console MIDlet is especially useful during the testing and debugging stages of application development. We can bundle it into our testing MIDlet Suite to view the database content at real time for diagnostic purposes. Screen shots of the MIDP Micro Console in action are shown in Figure 12.1. Figure 12.1. The PointBase Micro MIDP Console.![]() |