fill tables of an mysql database via odbc connector
Posted: Thu Sep 25, 2014 10:52 am
dear cummunity,
while testing this script
function jobArrived( s : Switch, job : Job )
{
var ordernumber = job.getNameProper();
dbConn = new DataSource();
dbConn.connect("data-test", "root", "");
if ( dbConn.isConnected() )
{
var len = job.getNameProper().length;
// var campaign = job.getNameProper().left(len - 12);
var campaign = job.getNameProper().left(12);
var jobname = job.getNameProper();
var quantity = job.getNameProper().right(3);
s.log(1,"Database connection succes" + ordernumber + "ja praat" + campaign + " " + jobname + " " + quantity);
dbStat = new Statement(dbConn);
dbStat.execute("rsp_insert_records '" + campaign + "'" + "," + "'" + jobname + "'" + "," + quantity);
dbConn.disconnect();
job.sendToSingle(job.getPath());
}
else
{
s.log(1,"Database connection error");
}
job.sendToSingle(job.getPath());
}
i Need help Debugging Switch, the odbc connector and the mysql database. If i feed a sample flow, i get the error "Database Connection error", and I do not know where to start searching. AFAIK the Connection via ODBC and mysql is working, so what values would i feed this Statement with?
dbConn.connect("data-test", "root", "");
data-test ist the odbc dsn, root would be the Password of the mysql database?
Tnak you in advance, Jan
----
ok, you can debug the odbc Driver in Microsoft and log it to file: here you'll find:
SwitchScriptExe 1bf4-1534 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 0x03529810
HWND 0x00000000
WCHAR * 0x71CB8B34 [ -3] "****** 0"
SWORD -3
WCHAR * 0x71CB8B34
SWORD -3
SWORD * 0x00000000
UWORD 0
DIAG [IM014] [Microsoft][ODBC Driver Manager] Der angegebene DSN weist eine nicht übereinstimmende Architektur von Treiber und Anwendung auf. (0)
So, that means you'll have to install the 32 bit Version of the mysql odbc driver
while testing this script
function jobArrived( s : Switch, job : Job )
{
var ordernumber = job.getNameProper();
dbConn = new DataSource();
dbConn.connect("data-test", "root", "");
if ( dbConn.isConnected() )
{
var len = job.getNameProper().length;
// var campaign = job.getNameProper().left(len - 12);
var campaign = job.getNameProper().left(12);
var jobname = job.getNameProper();
var quantity = job.getNameProper().right(3);
s.log(1,"Database connection succes" + ordernumber + "ja praat" + campaign + " " + jobname + " " + quantity);
dbStat = new Statement(dbConn);
dbStat.execute("rsp_insert_records '" + campaign + "'" + "," + "'" + jobname + "'" + "," + quantity);
dbConn.disconnect();
job.sendToSingle(job.getPath());
}
else
{
s.log(1,"Database connection error");
}
job.sendToSingle(job.getPath());
}
i Need help Debugging Switch, the odbc connector and the mysql database. If i feed a sample flow, i get the error "Database Connection error", and I do not know where to start searching. AFAIK the Connection via ODBC and mysql is working, so what values would i feed this Statement with?
dbConn.connect("data-test", "root", "");
data-test ist the odbc dsn, root would be the Password of the mysql database?
Tnak you in advance, Jan
----
ok, you can debug the odbc Driver in Microsoft and log it to file: here you'll find:
SwitchScriptExe 1bf4-1534 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 0x03529810
HWND 0x00000000
WCHAR * 0x71CB8B34 [ -3] "****** 0"
SWORD -3
WCHAR * 0x71CB8B34
SWORD -3
SWORD * 0x00000000
UWORD 0
DIAG [IM014] [Microsoft][ODBC Driver Manager] Der angegebene DSN weist eine nicht übereinstimmende Architektur von Treiber und Anwendung auf. (0)
So, that means you'll have to install the 32 bit Version of the mysql odbc driver