时间:2021-07-01 10:21:17 帮助过:22人阅读
_SQLPROXYURL_ = 'SQLProxy.php';
_SQLSERVERHOST_ = 'localhost';
_SQLUSERNAME_ = 'root';
_SQLPASSWORD_ = '';
_SQLDATABASE_ = 'HotelManageMent';
var result = "select * from Room".OnServer().executeSQL();
for(var i=0; i<result.length; i++) {
//do something here.... using result[i];
}
2.操作Javascript Object Array 、执行SQL操作:
代码如下:
var Room = [
{
ID: 'bot',
name: 'test',
sex: true
}, {
ID: 2,
name: 'test8',
sex: true
}, {
ID: 3,
name: 'test5',
sex: false
}, {
ID: 4,
name: 'test2',
sex: true
}];
SQL = "select Max(id) as bid,Sum(id) as total from records where name like \"test%\" group by sex order by id desc,name asc";
var result = SQL.executeSQL();
for(var i=0; i<result.length; i++) {
//do something here.... using result[i];
};
"create table mytable".executeSQL();
for(var j=0; j<100; j++) {
"insert into mytable (id,name,sex) values(2,'zhangsan',true) ".executeSQL();
};
sql语句都写外面了。安全吗?
关于安全问题首先这本身不打算做互联网应用,面向局域网。其次数据库的连接有ssl加密,其实http也有ssl,再者。远程调用服务只是JSQL的四大模块之一。还有可以不经过服务来操作客户端objects array,浏览器的sqlite和网页的DOM。我这里的SQL只是代表一种语言规范,适合但不局限于后端的sql数据库,还有三个模块是面对前段的操作