【www.gdgbn.com--同学】

这个是帮同学写的一个十分十分简单的一个例子,因为我手头没有移动设备,而且那个时候还不会用什么模拟器。。,所以就在本级调试成功就没有管了。数据库是用的SQL Anywhere,感觉这个还不错。因为以前也没有研究过,所以就觉得这东西方便。在下就不买瓜再次把SQL Anywhere怎么用详细讲了,我也是下了它的中文文档来研究的。如果那位仁兄想偷懒不想自己找就加我的sans_reason@hotmail.com 我发给你好了。呵呵
/*
* 如果部署到WindowsCE设备上把jul9.dll和jul9_zh.jar自己拷贝过去
* 设备应该安装Djeode
* 建立test.lnk
*18#"存储卡Insignia Solutions JeodeRuntimeevm.exe"
*-Djeode.evm.console.local.keep=TRUE
*-Djeode.evm.console.local.paging=TRUE
*-Djul.library.dir=UltraLitelib
*-cp UltraLite utorial;UltraLitelibjul9_zh.jar
*Customer
*/
/**
* @author LiYou
*
*
*/
import ianywhere.native_ultralite.*;
import java.sql.SQLException;
public class Customer{
static Connection conn;
public static void main( String args[]){
try{
Customer cust = new Customer();
cust.insert();
cust.select();
conn.close();
}catch( SQLException e){
e.printStackTrace();
}
}
public Customer() throws SQLException{
DatabaseManager dbMgr = new DatabaseManager();
/*
* UltraLite默认滴数据库用户名和密码。。。怎么改不知道,偶不会这个东西也没有研究
*/
String parms = "uid=DBA"
+ ";pwd=SQL"
+ ";file_name=f:j2metutcustomer.udb"
+ ";schema_file=f:j2metutcustomer.usm"
+ ";ce_file=UltraLitetutorialtutcustomer.udb"
+ ";ce_schema=UltraLitetutorialtutcustomer.usm";
/*
* 如果部署到WindowsCE设备上把这行添加两条
* ce_file=UltraLitetutorialtutcustomer.udb
* ce_schema=UltraLitetutorialtutcustomer.usm
*
* 在桌面应该系统中这两行没有效果滴!自己注意!
*/
try {

本文来源:http://www.gdgbn.com/zhufuduanxin/5688/