Accessing data

From PowerBuilder NVOs, you can access data using either JDBC data sources or Sybase native data sources.

StepsAccessing JDBC data sources in NVOs

  1. To set up a JDBC data source in an NVO, use the following PowerScript code, where DefaultDS is the name of an EAServer data source:

    sqlca.dbms = "JDBC"
    sqlca.dbparm = "CacheName=’DefaultDS’"
    
    connect;    // check error code
    ...         // use embedded SQL or DataStore
    
    disconnect; // check error code
    
  2. To assign a JNDI name to your JDBC data source, see “Configuring data sources” in Chapter 4, “Database Access,” in the EAServer System Administration Guide.

StepsAccessing Sybase native data sources in NVOs

  1. Use the following PowerScript code, where JCM_Sybase is the name of an EAServer data source:

    sqlca.dbms = "SYJ"
    sqlca.dbparm = "CacheName=’JCM_Sybase’"
    ...