12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * Created by benzhan on 15/8/10.
- */
- oujMySql = require('../framework/lib/oujMySql.js');
- objMysql = new oujMySql('Web');
- var sql = "SELECT * FROM `cUser`";
- var allDeferred = objMysql.getAll(sql, 5);
- allDeferred.then(function(rows) {
- console.log('getAll');
- console.log(rows);
- });
- var oneDeferred = objMysql.getOne(sql);
- oneDeferred.then(function(one) {
- console.log('getOne');
- console.log(one);
- });
- var colDeferred = objMysql.getCol(sql, 3);
- colDeferred.then(function(col) {
- console.log('getCol');
- console.log(col);
- });
- var colDeferred = objMysql.getRow(sql);
- colDeferred.then(function(row) {
- console.log('getRow');
- console.log(row);
- });
- //
- //var updateSql = "";
- //
- //objMysql.update(sql, function(err, rows) {
- // console.log('getAll');
- // console.log(rows);
- //}, 5);
- //setTimeout(function() {
- // objMysql.close(function() {
- // console.log('close');
- // });
- //}, 1000);
|