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.org download
The following is the source code of some JAVA operations on SQList:
Java code
Public String [] [] localHostQuery (String SQL ){
String re [] [] = null;
Try {
Class. forName ("org. sqlite. JDBC ");
Connection conn = DriverManager. getConnection ("jdbc: sqlite: buffer. db ");
Statement stat = conn. createStatement ();
ResultSet rs = stat.exe cuteQuery (SQL); // query data
ResultSetMetaData md = rs. getMetaData ();
Re = new String [500] [md. getColumnCount ()];
Int I = 0;
Try {
While (rs. next ()){
For (int j = 0; j <md. getColumnCount (); j ++ ){
Re [I] [j] = rs. getString (j + 1 );
}
I ++;
}
} Catch (Exception e ){
E. printStackTrace ();
}
Rs. close ();
Conn. close (); // end the database connection
} Catch (Exception e ){
E. printStackTrace ();
}
Return re;
}
Public int localHostUpdate (String SQL ){
Int I = 0;
Try {
Class. forName ("org. sqlite. JDBC ");
Connection conn = DriverManager. getConnection ("jdbc: sqlite: buffer. db ");
Statement stat = conn. createStatement ();
I = stat.exe cuteUpdate (SQL );
Conn. close ();
} Catch (Exception e ){
E. printStackTrace ();
}
Return I;
}
The author "don't look at how fast it is, but how far it is ."