Example:
the column contains the data: 2014-01-22 08:40:52.500,
fieldTIME = JDBC_GetColC(rs:1) returns me only 2014-01-22
This the code:
Code: Select all
enval = '/home/alext/java/jdbc/mssql-jdbc-12.6.0.jre8.jar';
putenv('CLASSPATH='+enval:qusec);
prop = JDBC_Properties();
JDBC_setProp(prop: 'user' : 'user');
JDBC_setProp(prop: 'password' : 'password');
JDBC_setProp(prop: 'database' : 'dbMhs0997');
JDBC_setProp(prop: 'encrypt' : 'false');
JDBC_setProp(prop: 'trustServerCertificate' : 'false');
conn = JDBC_ConnProp(
'com.microsoft.sqlserver.jdbc.SQLServerDriver'
:'jdbc:sqlserver://192.168.0.20:50690'
: prop );
JDBC_freeProp(prop);
if (conn = *NULL);
snd-msg 'Not connected';
return;
endif;
monitor;
rs = JDBC_ExecQry(conn:'SELECT top 1 * FROM dtLu');
if rs = *null;
JDBC_close(conn);
return;
endif;
dow JDBC_NextRow(rs);
fieldTIME = JDBC_GetColC(rs:1);
snd-msg 'field: '+fieldRs;
enddo;
JDBC_FreeResult(rs);
on-error;
JDBC_close(conn);
return;
endmon;
JDBC_close(conn);
return;
i used both mssql-jdbc-12.6.0.jre8.jar and jtds-1.3.1.jar