Enterprise J2ME Developing Mobile Java Applications [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Enterprise J2ME Developing Mobile Java Applications [Electronic resources] - نسخه متنی

Michael Juntao Yuan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



12.1 PointBase Micro Edition


Among 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



public void connect() {
try {
Connection c = DriverManager.getConnection(
"jdbc:pointbase:micro:" +
m_dbname, "PBPUBLIC", "PBPUBLIC");
Statement s = c.createStatement();
} catch (Exception ex) {
// Handle the error
}
}

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.



/ 204