When inserting the tuples i have the following error:
there was not enough remaining storage space, or the storage quota was
reached and the user declined to allow more space (Code 4)
My questions:
1. how to list the database managed by the web navigator ?
2. Where are stored the databases ?
3. How to remove a database ?
The code:
function initDb() {
try {
if (!window.openDatabase) {
} else {
shortName = 'transactions5';
version = '1.0';
displayName = 'Transactions5';
maxSize = 2000000; // in bytes
db = openDatabase(shortName, version, displayName, maxSize);
}
} catch(e) {
if (e == INVALID_STATE_ERR) {
console.log("Invalid database version.");
} else {
alert("Unknown error "+e+".");
}
}
return db;
}
function createTables(db) {
db.transaction( function (transaction) {
transaction.executeSql('CREATE TABLE IF NOT EXISTS user(id INT NOT
NULL PRIMARY KEY, firstName CHAR(35), lastName CHAR(35), age INT,
address CHAR(40), email CHAR(20), phone CHAR(15));');
});
}
function createUsers(users) {
db.transaction( function (transaction) {
while (users.length > 0) {
user = users.pop();
console.log("User: " + user.firstName + " " + user.lastName, + " "
+ user.age + " " + user.address + " " + user.email + " " +
user.phone);
transaction.executeSql('INSERT INTO user(firstName, lastName, age,
address, email, phone) values (?, ?, ?, ?, ?, ?);', [user.firstName,
user.lastName, user.age, user.address, user.email, user.phone], null,
errorHandler);
}
endTime = new Date().getTime();
alert(endTime-startTime);
});
}
> My questions:
> 1. how to list the database managed by the web navigator ?
> 2. Where are stored the databases ?
> 3. How to remove a database ?
My understanding of the Web SQL Database spec, is that the answers you're looking for are: 1) you can't, 2) *somewhere*, but it depends on the browser - ie. you can't get it, 3) and you can't.
Or certainly that's what I got from the specifications!
Remy Sharp
Any idea regarding my error message ?