// Open a connection var myConn = database.connect("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); if (myConn.connected()) { // You are connected, so perform any tasks here }else{ // There was an error connecting to the database write('Error (' + myConn.minorErrorCode() + '): ' + myConn.minorErrorMessage); }