BBj Filesystem Plugin


Ensure that the config file contains the following entry when running the demo listed below:

ALIAS J3 com.basis.plugin.SQLOpenPlugin
"jdbc:basis:localhost?database=ChileCompany&user=guest"

REM Requires ALIAS J3 com.basis.plugin.SQLOpenPlugin
"jdbc:basis:localhost?database=ChileCompany&user=guest"

REM Open the customer table in the ChileCompany DB
OPEN (1,MODE="table=CUSTOMER")"J3" 

REM Get the record template
LET REC_TEMPLATE$=TMPL(1,IND=1)                      
PRINT "RECORD TEMPLATE: " + REC_TEMPLATE$

REM Get the key template
LET KEY_TEMPLATE$=TMPL(1,IND=2)                      
PRINT "KEY TEMPLATE: " + KEY_TEMPLATE$

REM Write a record to the customer table
DIM REC$:REC_TEMPLATE$
REC.CUST_NUM$="000075"
REC.FIRST_NAME$="Brian"
REC.LAST_NAME$="Johnson"
REC.COMPANY$="BASIS"
REC.BILL_ADDR1$="5901 Jefferson"
REC.BILL_ADDR2$=""
REC.CITY$="Albuquerque"
REC.STATE$="NM"
REC.COUNTRY$="US"
REC.POST_CODE$="87109"
REC.PHONE$="5053455232"
REC.FAX$="5053455082"
REC.SALESPERSON$="BOB"
REC.SHIP_ZONE$="01"
REC.SHIP_METHOD$="FEDEX"
REC.CURRENT_BAL$="50.60"
REC.OVER_30$="7"
REC.OVER_60$="170"
REC.OVER_90$="170"
REC.OVER_120$="0"
REC.SALES_MTD$="56"
REC.SALES_YTD$="556"
REC.SALES_LY$="340"
REC.LAST_PURCH_DATE$="1999-12-19"
REC.LAST_PAY_DATE$="2001-12-14"
REC.CREDIT_CODE$="01"
WRITE RECORD(1) REC$

REM Read a record in the customer table
READ RECORD (1,KEY="000075")REC$     
PRINT REC$                           

REM Close the customer table in the ChileCompany DB
CLOSE (1)

 

To use a different ODBC or JDBC driver (such as Oracle, SQL Server, MySQL, etc.), change the connection string specified in the ALIAS declaration in the config.bbx. For example, to use a SQL Server ODBC data source called "MyDatabase", change the line in the config.bbx file that reads:

 ALIAS J3 com.basis.plugin.SQLOpenPlugin
"jdbc:basis:localhost?d
atabase=ChileCompany&user=guest"

To:
 ALIAS J3 com.basis.plugin.SQLOpenPlugin "jdbc:odbc:MyDatabase"


Or, if using a MySQL JDBC driver to access a MySQL database called "MyDatabase," change:

  ALIAS J3 com.basis.plugin.SQLOpenPlugin
"jdbc:mysql://myser
ver:3306/MyDatabase"

NOTE:  If using a third party JDBC driver to connect to a database (as in the MySQL example above), ensure that the JDBC driver's .jar file is included in the BBj CLASSPATH. Using the
Enterprise Manager, login, and then double-click on the "Java Settings" node. Click on the CLASSPATH tab and then click the "Add" button. Enter the full path to the .jar file containing the necessary JDBC driver files. Lastly, restart BBjServices to get the new JDBC driver loaded into memory.

For additional information about com.basis.plugin, see Java API document.