Dynamics AX Knowledge

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

You can copy it to a job:  

  LoginProperty           loginProperty = new LoginProperty();
    ODBCConnection      con;
    Statement                stmt;
    str                           sqlString, result;
    ResultSet                 resultSet;
    ;

    loginProperty.setServer('servername');
    loginProperty.setDatabase('DB name');
    loginProperty.setUsername('username');
    loginProperty.setPassword('pwd');
    con = new ODBCConnection(loginProperty);
    sqlString = "select * from Address"  ;
    stmt = Con.createStatement();
    resultSet = Stmt.executeQuery(sqlString);
    resultSet.next();
    result = resultSet.getString(1);
    if (result)
    {
        info(result);
    }
    else
    {
        info( "No record! " );
    }

posted on 2008-10-07 16:14  Jacky Xu  阅读(282)  评论(0编辑  收藏  举报