Principalsteps are:1) Java application which establishes eXtremeDB database instance should createdatabase in shared memory. Database open flag 'Database.MCO_CFG_SHARED_MEMORY'and memory device class 'Database.SharedMemoryDevice' should be used instead ofordinary memory device class 'Database.PrivateMemoryDevice'. See sample'samples/java/open' and sample command line option 'shm' for detailedexplanation.
2) Utility 'xsql' (samples/native/sql/xsql) should be built using eXtremeDBshared memory library. Just compile the sample with option PRJ_MEMDEV=SHARED onUnix. On Windows check in sample's VisualStudio project properties that library'mcomw32.lib / mcomw32_debug.lib' is linked instead of library 'mcomconv.lib /mcomconv_debug.lib'. And then compile the sample.
3) Start Java application first. Then start 'xsq' utility to connect to adatabase created by Java application and share it via remote SQL interface.Connect to eXtremeDB SQL server using rSQL C API native interface or ODBC orJDBC drivers. See SQL documentation and sample 'samples/jdbc' for furtherexplanations.
4) As Java application and 'xsql' utility use the same data structures inshared memory always use the same eXtremeDB distributive to build bothapplications. Transaction manages (MURSIW/MVCC), synchronization libraries andin-memory/disk libraries set must be the same for both applications too.
Example scenario 'from a box' using standard samples:
1) Compile Java application 'samples/java/open' using script'samples/java/compile'
2) Compile 'samples/native/sql/xsql' utility by command 'gmakePRJ_MEMDEV=SHARED DEBUG=on all' on Linux or using Visual Studio on Windows.Check Visual Studio project properties that library 'mcomw32_debug.lib' islinked instead of library 'mcomconv_debug.lib'.
3) Make a copy of original file 'SimpleJDBC.java' and replace it by patchedversion which is attached to this email.
4) Compile sample 'samples/jdbc' using script 'samples/jdbc/compile'.
5) Go to directory 'samples/java/open' and start Java application by commandline 'Open.bat debug shm' (or 'Open.sh debug shm').
6) In another console go to root directory of eXtremeDB installation and startSQL server application 'target/bin/xsql opendb:5001' (on port 5001).
7) Type into xsql console 'select * from Metatable;' to print databasestructure and double-check connection to a database created by sample 'open'.Output should be like this:
XSQL>select * from Metatable;
TableName FieldNo FieldName FieldTypeName FieldType FieldSize AutoGenerated ReferencedTable
------------------------------------------------------------------------------
OpenObj 1 i4 Int4 6 0 false null
Selected records: 1
8) In another console go to directory 'samples/jdbc' and start JDBC sample'SimpleJDBC.bat' (or 'SimpleJDBC.sh'). It should print the same databasecontent using remote SQL connection. Output should be like this:
Connecting to Database URL = jdbc:extremedb:localhost
Connected...
TableName FieldNo FieldName
OpenObj 1 i4
--------------
Now closing the connection