Mixing Conduits with JDBC Hot Syncing Palm Programs
Mixing Conduits with JDBC Hot. Sync®-ing Palm® Programs, Java Style with Database Connectivity by Mike Kirschman
Goals During Hot. Sync® n n n Translate text to HTML code Include Graphics as <img>’s (postponed to later time) Allow Replacement Variables n n Where variable value will be drawn from SQL database Allow XML output (postponed to later time)
The Palm® Model n Do minor processing on the handheld. Minor data entry n Data display (often only a subset of data) n Small remote database queries (if capable) n Etc. n n Do major processing on PC/Laptop Large data entry n Extended processing n Internet (though, some appearing on HH) n Larger database queries. n
Conduits Overall Conduit Design 1. Read HH data to PC (Hot. Sync®) 2. Read PC copy of data into conduit 3. Read PC data 4. Determine type of sync necessary: 5. Write data to HH or PC as necessary The JDBC substitutions happen here.
Why Use JDBC n n Provides a fairly portable database interface (just need JDBC driver, which are usually free with the database. ) Fairly simple interface to use. Combined with Java, GUI Database programs are rather straight-forward to write. (Also, can use JSP/Servlets technology for web. ) (For my project) Because I already wrote the Conduit in Java.
Simple JDBC Example Class. for. Name(driver. Name); // Load Driver Connection con = Driver. Manager. get. Connection(db. URL, username, password); Result. Set rs = con. execute. Query(“Select * from customer”); while (rs. next()) { String customer = rs. get. String(“cname”); … } rs. close(); con. close();
What’s It Good For? n n n Sales manager can write “form letter” (or email) while traveling. Reports can be written during a collaborative meeting without the requirement that someone bring a laptop (inserting data later where not known. ) With dynamic SQL, reports could be programmed while riding the train to work.
More Information n Palm OS® Development: http: //www. palmone. com/us/developers Other Palm Resources: http: //ardiri. com (look for Palm Development Kit, Pil. RC, & j. Code) Conduit Development: http: //www. palmos. com/dev/tech/conduits n IDE-Based Development: http: //www. metrowerks. com/MW/develop/Wireless/Palm. OS/Professional/ n JDBC, JSP, and Servlet Development http: //java. sun. com Core Servlets and Java. Server Pages by Marty Hall (© Prentice Hall) (There are many other books on the topic, as well. )
- Slides: 8