layout | title | categories | parent | weight |
---|---|---|---|---|
post |
ODBC Driver |
SBP |
data-access-patterns.html |
1200 |
{% compositionsetup %}
{% tip %}
Summary: {% excerpt %}Access GgaSpaces Data-Grid via ODBC Driver{% endexcerpt %}
Author: Shay Hassidim, Deputy CTO, GigaSpaces
Recently tested with GigaSpaces version: XAP 7.1
Last Update: April 2010
{% toc minLevel=1|maxLevel=1|type=flat|separator=pipe %}
{% endtip %}
GigaSpaces Data-Grid support standard data access API. One of them is the JDBC Driver. Using the JDBC API and ODBC-JDBC bridge such as the one comes from Open Link Software, you can use standard ODBC API to access the GigaSpaces Data-Grid.
- You can download Gigaspaces java version from http://www.gigaspaces.com/LatestProductVersion.
- Unzip the downloaded file into a directory on your local machine. (Note: make sure the directory path does not have any spaces). This directory will be referred as in further instructions.
- Download and install the latest version of Java JDK.
- Set a
JAVA_HOME
variable to the path where you have installed the JDK.
- Start the GigaSpaces Agent by running \bin\gs-agent.bat(bat).
- Start the management UI by running \bin\gs-ui.sh(bat).
Create a new user "user" and password "password" and grant it all access privileges. See GigaSpaces Management Center Security for instructions.
- Click the "Deploy In-Memory Data Grid" button (top left, second button) in the UI.
- In the dialog select the following properties:
{% highlight java %} DataGrid Name : mySpace Space Schema : default Secured Space checkbox enabled User name : user, password: password Cluster Schema {% endhighlight %}
And deploy the space.
- Download and install the ODBC-JDBC bridge from http://uda.openlinksw.com/odbc/st/odbc-jdbc-bridge-st.
- Set the following environment variables in your system:
{% highlight java %} PATH=\jre\bin\server;%PATH% CLASSPATH=lib\required\commons-logging.jar; \lib\required\gs-openspaces.jar;\lib\required\gs-runtime.jar; \lib\required\spring.jar {% endhighlight %}
- Create a new OpenLink ODBC datasource with the following properties:
{% highlight java %} JDBC Driver : com.j_spaces.jdbc.driver.GDriver URL String: jdbc:gigaspaces:url:jini:////mySpace User name User name : user, Password: password {% endhighlight %}
You can test the connection using the openlink sample application at Program Files\OpenLink Software\UDA\Samples\Odbc