Using PointBase Server
with BEA WebLogic Server™

 

PointBase      Samples and Tutorials

 

 

 

 


How WebLogic Server Uses PointBase Server
Starting PointBase Server
Stopping PointBase Server
The Samples Database
Opening the PointBase Console
PointBase Schemas
Running a Code Example with PointBase
PointBase Licensing Restriction

*Please note the following conventions that are used throughout this document:

How WebLogic Uses PointBase Server

PointBase Server is a pure Java relational database management system (RDBMS) shipped with WebLogic Server. Its purpose is to allow you to run code examples with a functional database server. You can only use PointBase Server as a demonstration database with WebLogic Server documentation and examples. PointBase Server is for demonstration use only, (that is, non-production use) with WebLogic Server documentation and examples. The WebLogic Pet Store application and most of the WebLogic examples use PointBase as a database server.

Starting PointBase Server

PointBase Server starts automatically when you start WebLogic Server.

The PointBase Server runs in its own command window; do not close this window or the PointBase Server will shut down and you will not be able to run most of the examples on the examples Server.

If you wish to run PointBase without WebLogic Server, we have provided scripts that will start PointBase. On Windows, run:

SAMPLES_HOME/server/eval/pointbase/tools/startPointBase.cmd

On UNIX run:

SAMPLES_HOME/server/eval/pointbase/tools/startPointBase.sh

Stopping PointBase Server

PointBase Server runs as a separate process from WebLogic Server. However, to stop PointBase you shutdown WebLogic Server; stopping WebLogic Server will also stop PointBase.

To stop PointBase Server:

The Samples Database

If you install WebLogic Server with the examples, you have a pre-built demonstration database in the SAMPLES_HOME\server\eval\pointbase\databases directory.

If you need to build your own database, add these commands to the startExamplesServer script in SAMPLES_HOME\server\config\examples, customizing them for your environment:


set POINTBASE_HOME=%WL_HOME%\samples\server\eval\pointbase
java utils.Schema "jdbc:pointbase:server://localhost/demo" 
       com.pointbase.jdbc.jdbcUniversalDriver 
       -u examples -p examples -verbose examples/utils/ddl/demo.ddl

Where you see the boldface text, substitute the pathname to your database and the name of your DDL file. For more information on using utils.Schema, see Using the WebLogic Utilities.

Opening the PointBase Console

The PointBase Server console has a graphical user interface that you can use to query the demo database and view results.

To open the PointBase Console:

  1. Start WebLogic Server and PointBase Server.
  2. If you are using Windows, run the SAMPLES_HOME/server/eval/pointbase/tools/startPointBaseConsole.cmd. On Unix, run SAMPLES_HOME/server/eval/pointbase/tools/startPointBaseConsole.sh. These scripts will start the PointBase Console.
  3. In the dialog box Connect to Database, enter these values (or make sure they are the default values):

    • Driver    com.pointbase.jdbc.jdbcUniversalDriver
    • URL    jdbc:pointbase:server://localhost/demo
    • User    examples
    • Password    examples

  4. Click OK. You should see the database URL in the window title bar.

*You can use any username/password combination to enter Pointbase; however, you will only be able to make changes if you enter the correct username/password for the schema you desire to edit.

Once the console is open, you can enter a query and view database tables and columns. You can do this by choosing a standard query from the SQL menu, such as SELECT * FROM SYSUSERS or by entering a query in the top pane.

The console displays the matching rows in the bottom pane.

 

PointBase Schemas

Earlier versions of WebLogic Server had separate databases for the examples and petstore domains. Now, with PointBase, WebLogic Server uses a single database with different schemas.

PointBase uses schemas to support multiple database connections. Schemas operate much the same way as multiple databases, and they are completely separate entities within the database they share. A schema can contain tables that have the same names as tables in other schemas. Users can be set up to have rights and permissions to specific schemas and not to other schemas.

Schemas fullfills the roles of multiple databases, with the added convenience of simplified administration. For more information, check the PointBase documentation.

WebLogic Server 7.0 uses one schema for the examples domain and another three for the petstore domains. The correct username and password will allow you to make changes to the respective schema. To edit a schema, open your PointBase console and pull down the DBA menu and select 'Connect to a database.' Then fill in the username and password; the username and password for each schema is its name.

The schemas names are:

  1. examples
  2. petstore
  3. petstoreopc
  4. petstoresupplier

To view or edit any schema:

  1. Open the PointBase Console by following the steps in Opening the PointBase Console. If you wish to edit the schema, when you get to step 6 in those instructions enter the user name and password for the schema you want to view.
  2. Choose Catalog > Catalog .. from the menu.
  3. In the Catalog View, expand the schema you are interested in.

  4. Continue to expand the nodes to view the tables, columns, and column data types.

Running a Code Example with PointBase

This section describes how to run the jdbc.datasource.simplesql example using PointBase Server and the demo database.

  1. If you changed the number of the listen port (from 7001) when you installed WebLogic Server, you also need to change it in this line in the Java source file at SAMPLES_HOME\server\src\examples\jdbc\datasource\simplesql.java :
        ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    

  2. Open a command window.

  3. Start the examples server: cd SAMPLES_HOME\samples\server\config\examples startExamplesServer

  4. To open the Administration Console, point a browser to http://localhost:7001/console

  5. In the WebLogic Server Administration Console, go to Services > JDBC > Tx Data Sources.

  6. Look for or create a data source named examples-dataSource-demoPool. The data source should have these attributes:
    • JNDI Name: examples-dataSource-demoPool
    • Pool Name: demoPool
    • Targets-Server (on the Targets tab:) examplesServer

  7. In JDBC > Connection Pools, create or make sure a connection pool named dataSource exists and has these attributes:
    • URL: jdbc:pointbase:server://localhost/demo
    • Driver Classname: com.pointbase.jdbc.jdbcUniversalDriver
    • Properties: user=examples
    • Password: (hidden, but is: examples)
    • Targets-Server (on the Targets tab): examplesServer

  8. Open a new command window.

  9. Set the examples environment:
    • cd SAMPLES_HOME\server\config\examples
    • setExamplesEnv

  10. Compile the example: ant

  11. Run the example: ant run

    You should see output similar to this:

    C:\java examples.jdbc.datasource.simplesql
    Making connection...
    
    Table empdemo doesn't need to be dropped.
    Table empdemo created.
    Number of rows inserted = 1
    Number of rows deleted = 1
    

PointBase Licensing Restriction

Pointbase Server is an all-Java DBMS product included in the WebLogic Server distribution solely in support of WebLogic Server evaluation, either in the form of custom trial applications or through packaged sample applications provided with WebLogic Server. Non-evaluation development and/or production use of the Pointbase Server requires a separate license be obtained by the end user directly from Pointbase.