You must use access to create an Access database in advance. (There may be other methods, but this is just my first understanding)
However, it seems that we still use the copy method.
However, I don't pay attention to how to create an Access database here, because I just want to implement it. I can use a Java software with an MDB file to go everywhere.
Previously, I always thought that access should be configured and what should be installed, but it seems that access should be free of configuration. This requires further research.
I tried to use hsql before and found that it is very tasteless. It is only suitable for testing for temporary use or long-term shutdown.Program. For a small desktop program like me, it is too slow to re-build the entire database every time it is started. Initialization takes over 10 seconds. Then the query speed is slow ~~
I tried Java to connect to access, which is very efficient.
String URL = " JDBC: ODBC: Driver = {Microsoft Access Driver (*. mdb)}; DBQ = mydzsw. MDB " ;
Try {
// Note: there is a space between driver and (*. mdb ).
Connection con = Drivermanager. getconnection (URL );
Statement sta = Con. createstatement ();
For ( Int I = 0 ; I < 100000 ; I ++ ){ // 1 minute 10 seconds
Sta.exe cute ( " Insert into persons values ( " + I + " , 'Note', '000000', '000000', '000000 ') " );
}
Resultset set = Sta.exe cutequery ( " Select * from persons where id_p = 63145 " ); // Millisecond level
Set. Next ();
System. Out. println (set. getstring ( 1 ));
Sta. Close ();
Con. Close ();
} Catch (Sqlexception ex ){
Logger. getlogger (newclass. Class . Getname (). Log (level. Severe, Null , Ex );
}