-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjdbc.js
45 lines (40 loc) · 1.19 KB
/
jdbc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
window.jdbc = {};
/*******************************************************************************
* window.jdbc.open(
* { url : 'jdbc:mysql://server/database',
* user : 'user',
* password : 'pass',
* class : 'com.mysql.jdbc.Driver'
* }, function() {
* alert('ok');
* }, function() {
* alert('error');
* });
*/
window.jdbc.open = function(str, success, error) {
cordova.exec(success, error, "Jdbc", "open", [ str ]);
};
/*******************************************************************************
* window.jdbc.executeQuery({ query : "select * from x" },
* function(result) {
* alert("ok");
* console.log(result);
* }, function(error) {
* alert(error);
* window.jdbc.close();
* });
*/
window.jdbc.executeQuery = function(str, success, error) {
cordova.exec(success, error, "Jdbc", "executeQuery", [ str ]);
};
/*******************************************************************************
* window.jdbc.close(
* function() {
* console.log('Connection Closed.');
* }, function(error) {
* alert(error)
* });
*/
window.jdbc.close = function(success, error) {
cordova.exec(success, error, "Jdbc", "close", []);
};