I wanna to display browser history url using sqlite and java. After running my code I get this error: SQLITE_BUSY] The database file is locked
here is my code.
public static void main(String[] args) {
try {
Class.forName("org.sqlite.JDBC");
String dataFolder = System.getProperty("user.home") + "\\AppData\\Local";
String google = dataFolder + "\\Google\\Chrome\\User Data\\Default\\History";
String dbURL = "jdbc:sqlite:"+google;
Connection conn = DriverManager.getConnection(dbURL);
if (conn != null) {
System.out.println("Connected to the database");
Statement statement = conn.createStatement();
ResultSet resultSet = statement.executeQuery("select * from PageURL");
System.out.println( " affichage avec succès");
conn.close();
}
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
and here is my error
java.sql.SQLException: [SQLITE_BUSY] The database file is locked (database is locked)
at org.sqlite.core.DB.newSQLException(DB.java:890)
at org.sqlite.core.DB.newSQLException(DB.java:901)
at org.sqlite.core.DB.throwex(DB.java:868)
at org.sqlite.core.NativeDB.prepare(Native Method)
at org.sqlite.core.DB.prepare(DB.java:211)
at org.sqlite.jdbc3.JDBC3Statement.executeQuery(JDBC3Statement.java:81)
at JdbcSQLiteConnection.main(JdbcSQLiteConnection.java:28)
please help
Aucun commentaire:
Enregistrer un commentaire