SHARE
TWEET

Untitled

a guest Mar 17th, 2018 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mysql = require('mysql');
  2.  
  3. var connection = mysql.createConnection({
  4.   host: '192.168.0.51',
  5.   user: 'root',
  6.   password: 'decisionM45#',
  7.   database: 'ojsbcbs'
  8. });
  9.  
  10. var connection2 = mysql.createConnection({
  11.   host: '192.168.0.1',
  12.   user: 'root',
  13.   password: 'decisionM45#',
  14.   database: 'ojsbcbs'
  15. });
  16.  
  17. now=new Date();
  18. today=now.getFullYear()+now.getMonth()+now.getDate()
  19. const query="select count(*) from tr001 where tenant=(select tenant from ten01) and trdate="+today+";"
  20.  
  21. connection.query({sql:query,timeout:15000},
  22.   function (err, rows, fields) {
  23.     console.log("DATABASE 192.168.0.51");
  24.     console.log(rows);
  25. });
  26.  
  27. connection2.query({sql:query,timeout:15000},
  28.   function (err, rows, fields) {
  29.     console.log("DATABASE 192.168.0.1");
  30.     console.log(rows);
  31. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top