当要设置是否是可读或者是隐藏时,在java中除了提供File.setReadOnly()外,就无其他方法了
你可以在java中用Runtime.getRuntime().exec( "attrib " + "\ " " + file.getAbsolutePath() + "\ " "+ " +R ")该方法可以实现
http://answers.yahoo.com/question/index?qid=1006042717221
If you do a Compact and Repair within Access, this should solve the problem. Go to TOOLS > DATABASE UTILITIES > Compact and Repair Database.
Asp.Net web applications run under the ASPNET windows user account. When your code tries to open the connection Access creates the LDB file. Therefore ASPNET has to have write\create\modify permissions on the folder where you database exists. So, you'll need to change those settings if you have access to the server. If it's a hosting company you'll need to have them change it for you.
The way to get rid of this probleme you should be looking to close connection to the database other wise you will have those lck files on your computer.
http://www.diybl.com/course/3_program/java/javajs/20100719/459320.html
java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@afdb14ea[file =D:\db\human.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: 另一个程序已锁定文件的一部分,进程无法访问。 : D:\db\human.lck
原写法:
def sql = Sql.newInstance("jdbc:hsqldb:file:d:/db/human;ifexists=true", "sa",
"", "org.hsqldb.jdbcDriver")
正确写法:
def sql = Sql.newInstance("jdbc:hsqldb:hsql://localhost/xdb;ifexists=true", "sa",
"", "org.hsqldb.jdbcDriver")