例子:
var db = new RemoteDatabase();
if (db.connect('xx.xx.xx.xx', '3306', 'test', 'user', '1111111')) {
var rr = db.query('select * from t')
console.log('rr:', rr)
db.disconnect()
}
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| dbName | string | 必填 | 数据库名 |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| host | string | 必填 | 数据库服务器ip地址 |
| port | string | 必填 | 数据库服务器端口 |
| dbName | string | 必填 | 数据库名 |
| username | string | 必填 | 用户名 |
| password | string | 必填 | 密码 |
| 参数名 | 类型 | 必填 | 说明 |
|---|
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| sql | string | 必填 | sql语句 |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| sql | string | 必填 | sql语句 |