hi...
try like below..
You may use Connection class. By default this will establish a
connection to the current database session. Code snippet from Developers
guide below.
server static void main(Args args)
{
Connection con = new Connection();
Statement stmt = con.createStatement();
ResultSet r;
str sql;
SqlStatementExecutePermission perm;
;
sql = strfmt('SELECT VALUE FROM SQLSYSTEMVARIABLES');
// Set code access permission to help protect the use of
// Statement.executeUpdate.
perm = new SqlStatementExecutePermission(sql);
perm.assert();
try
{
r = stmt.executeQuery(sql);
while (r.next())
{
print r.getString(1);
pause;
}
}
catch (exception::Error)
{
print "An error occured in the query.";
pause;
}
// Code access permission scope ends here.
CodeAccessPermission::revertAssert();
}
for reference...
http://dynamicsuser.net/forums/p/43092/218217.aspx