A file-based database is a very special database. Because they do not have network interfaces, they generally cannot be called in a distributed manner. However, they have great advantages. If they are used for data configuration and data caching, the software efficiency can be improved.
I prefer sqlist for such a variety of file databases,
1. It is a stable database;
2. Reduce data type conversion during development regardless of the data type;
3. It is more stable than other text data such as access;
Sqlitejdbc-v056.jar:Www.sqlite.orgDownload
Below are some java operations on sqlistSource code:
Public String [] [] localhostquery (string SQL) {<br/> string re [] [] = NULL; <br/> try {<br/> class. forname ("org. SQLite. JDBC "); <br/> connection conn = drivermanager. getconnection ("JDBC: SQLite: buffer. DB "); <br/> statement stat = Conn. createstatement (); <br/> resultset rs = stat.exe cutequery (SQL); // query data <br/> resultsetmetadata MD = Rs. getmetadata (); <br/> Re = new string [1, 500] [Md. getcolumncount ()]; <br/> int I = 0; <br/> try {<br/> while (RS. next () {<br/> for (Int J = 0; j <Md. getcolumncount (); j ++) {<br/> re [I] [J] = Rs. getstring (J + 1); <br/>}< br/> I ++; <br/>}< br/>} catch (exception E) {<br/> E. printstacktrace (); <br/>}< br/> Rs. close (); <br/> Conn. close (); // end the database connection </P> <p >}catch (exception e) {<br/> E. printstacktrace (); <br/>}< br/> return re; <br/>}</P> <p> Public int localhostupdate (string SQL) {<br/> int I = 0; <br/> try {<br/> class. forname ("org. SQLite. JDBC "); <br/> connection conn = drivermanager. getconnection ("JDBC: SQLite: buffer. DB "); <br/> statement stat = Conn. createstatement (); <br/> I = stat.exe cuteupdate (SQL); <br/> Conn. close (); <br/>}catch (exception e) {<br/> E. printstacktrace (); <br/>}< br/> return I; <br/>}