ITeye博客

node-mysql pool

maxer025 · 2016-07-15 17:37 · mysql pool · 移动开发 · Markdown

var mysql = require('mysql'); var pool = mysql.createPool(config);

pool.getConnection(function(err, connection) { // Use the connection connection.query( 'SELECT something FROM sometable', function(err, rows) { // And done with the connection. connection.end();

// Don't use the connection here, it has been returned to the pool.

}); });

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。