MT6235 08B 的功能浏览 2
6. FONT_ENGINE 矢量字库
7. CMMB_SUPPORT 中国移动多媒体广播 China Mobile Multimedia Broadcasting CMMB规定了在广播业务频率范围内,移动多媒体广播系统广播信道传输信号的帧结构、信道编码和调制,该标准适用于30MHz到3000MHz频率范围内的广播业务频率,通过卫星和/或地面无线发射电视、广播、数据信息等多媒体信号的广播系统,可以实现全国漫游。
8. SQLITE3_SUPPORT 1.SQLite简介 ii.Serverless:大多数SQL数据库引擎都作为一个独立的服务器进程,应用程序通过使用一些协议,比如TCP/IP来发送请求给服务器,并接受结果,以这种方式来与数据库服务器进行通信。SQLite与此不同,进程可以通过访问数据库直接进行数据库文件的读写而不需要中间层的服务器进程。这样的实现的主要的好处是不需要进行安装,配置,初始化,管理以及维护单独的服务进程。但是,数据库引擎可以通过使用服务器来预防客户端应用程序的bug,确保服务器不被客户端的错误所损坏。大多数SQL数据库都是基于C/S模式的,在serverless的数据库中,SQLite是目前唯一允许多个应用同时访问的。iii.Zero-Configuration:SQLite不需要任何配置---install、setup、configure server、administration、create instance、assign permissions、recover、troubleshooting。iv.Transactional:SQLite实现了ACID(Atomic-原子性,Consistent-一致性隔离性持久性)。SQLite实现了序列化事务来保证ACID,即使发生程序异常,操作系统异常或者电源故障。v.Most Widely Deployed SQL Database:大多数数据库是C/S模式的,而一台服务器可以为很多人提供服务,而SQLite是嵌入式的数据库软件,大多数用户会同时使用多个数据库的拷贝。SQLite大量的被用于手机,PDA,MP3播放器以及机顶盒设备。下面列举了一些使用SQLite作为嵌入式服务器的应用: vi.OpenSource:SQLite处于public domain中,官方声明如下:
3.下载与使用 1. E:/tools/sqlite>sqlite3.exetest 2. SQLiteversion3.6.11 3. Enter".help"forinstructions 4. EnterSQLstatementsterminatedwitha";" 5. sqlite>.help 6. .backup?DB?FILE BackupDB(default"main")toFILE 7. .bailON|OFF Stopafterhittinganerror. DefaultOFF 8. .databases Listnamesandfilesofattacheddatabases 9. //lotsofotherhelpinformationomittedhere 10. .widthNUMNUM... Setcolumnwidthsfor"column"mode 11. sqlite>.databases 12. seq name file 13. 14. --- --------------- ---------------------------------------------------------- 15. 16. 0 main E:/tools/sqlite/test 17. 18. sqlite>createtablestudent(idvarchar(10),namevarchar(20),agesmallint); 19. sqlite>select*fromstudent; 20. sqlite>insertintostudentvalues('1001','lovesizhao',26); 21. 22. 1001|lovesizhao|26 23. sqlite>droptablestudent; 24. sqlite>.quit
ii.下载Java JDBC Driver for SQLite3 SQLite3Util.java 1. packagesqlite3; 2. importjava.sql.Statement; 3. java.sql.Connection; 4. java.sql.DriverManager; 5. java.sql.ResultSet; 6. java.sql.SQLException; 7. java.util.logging.Level; 8. java.util.logging.Logger; 9. 11. publicfinalclassSQLite3Util{ privatefinalstaticStringURL="jdbc:sqlite:"; privatefinalstaticStringTEST="test"; privatestaticConnectiongetConnection(Stringurl)throwsSQLException{ Connectionconn=null; try{ Class.forName("org.sqlite.JDBC"); conn=DriverManager.getConnection(url); }catch(ClassNotFoundExceptionex){ Logger.getLogger(SQLite3Util.class.getName()).log(Level.SEVERE,null,ex); }finally{ 25. returnconn; 26. } 27. 28. 29. publicstaticConnectiongetSQLite3Connection()throwsSQLException{ 30. returngetConnection(URL+TEST); 31. 32. 33. publicstaticConnectiongetSQLite3Connection(Stringdatabase)throwsSQLException{ 34. //Heredatabasecanbedatabasename,databasefilenameormemory: 35. //Connectionconnection=DriverManager.getConnection("jdbc:sqlite:C:/work/mydatabase.db"); 36. //Connectionconnection=DriverManager.getConnection("jdbc:sqlite:/home/leo/work/mydatabase.db"); 37. //Connectionconnection=DriverManager.getConnection("jdbc:sqlite::memory:"); 38. returngetConnection(URL+((database==null||database.equals(""))?TEST:database)); 39. 40. 41. publicstaticvoidclose(Connectionconn,Statementstmt,ResultSetrs)throwsSQLException{ 42. if(conn!=null){ 43. conn.close(); 44. 45. if(stmt!=null){ 46. stmt.close(); 47. 48. if(rs!=null){ 49. rs.close(); 50. 51. 52. 53. publicstaticvoidcloseQuiet(Connectionconn,ResultSetrs){ 54. 55. 56. 57. 58. }catch(SQLExceptione){ 59. Logger.getLogger(SQLite3Util.class.getName()).log(Level.WARNING,e); 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. }
sqlite3;
java.sql.Statement; java.sql.Connection; java.sql.DatabaseMetaData; java.sql.ResultSet; java.sql.SQLException; java.util.logging.Level; 9. java.util.logging.Logger; classSQLite3Test{ /** 14. *@paramargsthecommandlinearguments 15. */ publicstaticvoidmain(String[]args){ //declareandinitializedatabasenamesandjava.sqlobjects Connectionconn=null; Statementstmt=null; ResultSetrs=null; 21. StringstudentDB="D:/NetBeans/NetbeansProjects/SQLite3/student.db"; StringinmemoryDB=":memory:"; //thedbmdisusedtocheckwhatSQLite3JDBCdriverprovideforJDBC DatabaseMetaDatadbmd=null; try{ //getconnectiontodefaultdatabase:test conn=SQLite3Util.getSQLite3Connection(); if(conn==null){ return; } dbmd=conn.getMetaData(); //justprintinformationtostandardconsoleinsteadofoutputfile System.out.println("DatabaseProductName:"+dbmd.getDatabaseProductName()); System.out.println("SQLKeywords:"+dbmd.getSQLKeywords()); System.out.println("JDBCMajorVersion:"+dbmd.getJDBCMajorVersion()); System.out.println("JDBCMinorVersion:"+dbmd.getJDBCMinorVersion()); //getconnectiontodatabase:D:/NetBeans/NetbeansProjects/SQLite3/student.db conn=SQLite3Util.getSQLite3Connection(studentDB); stmt=conn.createStatement(); stmt.executeUpdate("droptableifexistsstudent.student"); stmt.executeUpdate("createtablestudent(idsmallintprimarykey,namevarchar(20))"); stmt.executeUpdate("insertintostudentvalues(1,'zhangzhongliang')"); stmt.executeUpdate("insertintostudentvalues(2,'liusizhao')"); rs=stmt.executeQuery("select*fromstudent"); inti=1; while(rs.next()){ System.out.println("rowno="+i); System.out.println("id="+rs.getInt("id")); System.out.println("name="+rs.getString("name")); i++; stmt.executeUpdate("droptablestudent"); //getconnectiontodatabaseinmemory //thiswillnotcreateadatabasedatafileinyourdisk conn=SQLite3Util.getSQLite3Connection(inmemoryDB); i=}catch(SQLExceptionex){ Logger.getLogger(SQLite3Test.class.getName()).log(Level.SEVERE,ex); }finally{ 77. SQLite3Util.closeQuiet(conn,stmt,rs); 78. 79. 80. 5.参考资料 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |