Question

I'm new to Blackberry. I use phonegap to create cross platform applications. I'm trying websql on blackberry using phonegap. My html file looks like this:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" charset="utf-8">
var db= openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);

var msg;
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS COMPANY (id unique, log)');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (1, "Unisys")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (2, "UGSI")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (3, "TCIS")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (4, "mobcomp")');
msg = '<p>Log message created and row inserted.</p>';
document.querySelector('#status').innerHTML = msg;

});


db.transaction(function (tx) {
tx.executeSql('SELECT * FROM COMPANY', [], function (tx, results) {
var len = results.rows.length, i;
msg = "<p>Found rows: " + len + "</p>";
document.querySelector('#status').innerHTML += msg;
for (i = 0; i < len; i++){
msg = "<p><b>" + results.rows.item(i).log + "</b></p>";
document.querySelector('#status').innerHTML += msg;
}

}, null);

});

</script>
</head>
<body>
<div id="status" name="status">Status Message</div>
</body>
</html>

This code is working fine with ANDROID. But on Blackberry the simulator is not displaying anything except the status message line. Can anyone please help me on this issue?

Thanks in advance, Akshatha

Was it helpful?

Solution

Blackberry 5.0 don't support HTML5 WebSQL, instead uses Google Gears API http://code.google.com/intl/es-ES/apis/gears/api_database.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top