{"id":50350517,"url":"https://github.com/gaiandb/gaiandb","last_synced_at":"2026-06-15T12:01:44.497Z","repository":{"id":35063514,"uuid":"39203115","full_name":"gaiandb/gaiandb","owner":"gaiandb","description":"A light-weight data-federation technology built on Apache Derby. Gaian accesses and transforms data securely \"at the edge\" and can discover other instances of itself to form a scalable data network.","archived":false,"fork":false,"pushed_at":"2023-01-12T08:11:56.000Z","size":41004,"stargazers_count":73,"open_issues_count":21,"forks_count":35,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-08-09T12:22:42.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaiandb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":"LICENSE/LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-16T14:56:07.000Z","updated_at":"2025-08-03T06:52:59.000Z","dependencies_parsed_at":"2023-01-15T13:15:30.103Z","dependency_job_id":null,"html_url":"https://github.com/gaiandb/gaiandb","commit_stats":{"total_commits":38,"total_committers":6,"mean_commits":6.333333333333333,"dds":"0.42105263157894735","last_synced_commit":"b2bf3c46a1f2c7fe7fe2619423277cf69917132e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gaiandb/gaiandb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaiandb%2Fgaiandb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaiandb%2Fgaiandb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaiandb%2Fgaiandb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaiandb%2Fgaiandb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaiandb","download_url":"https://codeload.github.com/gaiandb/gaiandb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaiandb%2Fgaiandb/sbom","scorecard":{"id":417185,"data":{"date":"2025-08-11","repo":{"name":"github.com/gaiandb/gaiandb","commit":"b2bf3c46a1f2c7fe7fe2619423277cf69917132e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/distributed/SampleProcedures.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/distributed/SampleUDFs.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/embedding/SampleApplicationEmbeddingGaian.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/policy/SamplePolicyForClusterPrivacy.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/policy/SamplePolicyNoFilters.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/vti/SampleHelloWorldVTI.class:1","Warn: binary detected: java/IntegrationSamples/com/ibm/gaiandb/vti/SamplePluralizedVTI.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/dsm/GaianNeighbourProvider.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/dsm/OpinionsBasedRouterDSM.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/GenericPolicyPluginForWPML$1.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/GenericPolicyPluginForWPML.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/PerfTestingPlugin.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/PolicyEnabledFilter$1.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/PolicyEnabledFilter.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/Util.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/AccessLogger.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/Column.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/DataSource.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/IColumn.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/IRow.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/QueryContext.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/RMG_specific_access.class:1","Warn: binary detected: java/PolicyPlugins/com/ibm/gaiandb/plugins/wpml/schema/Row.class:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derby.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_cs.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_de_DE.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_es.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_fr.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_hu.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_it.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_ja_JP.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_ko_KR.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_pl.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_pt_BR.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_ru.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_zh_CN.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyLocale_zh_TW.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyclient.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbynet.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbyrun.jar:1","Warn: binary detected: lib/DerbySDK_10.10.2.1.1643489/lib/derbytools.jar:1","Warn: binary detected: lib/Prefuse/prefusetrimmed.jar:1","Warn: binary detected: lib/SensorReader.dll:1","Warn: binary detected: lib/db2jcutdown.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE/LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T00:12:50.348Z","repository_id":35063514,"created_at":"2025-08-19T00:12:50.349Z","updated_at":"2025-08-19T00:12:50.349Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34361403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-29T21:00:23.924Z","updated_at":"2026-06-15T12:01:44.486Z","avatar_url":"https://github.com/gaiandb.png","language":"Java","funding_links":[],"categories":["数据库"],"sub_categories":["微服务框架"],"readme":"# GaianDB\nA light-weight data-federation technology built on Apache Derby. Gaian accesses and transforms data securely \"at the edge\" and can discover other instances of itself to form a scalable data network.\n\n\u003cHTML\u003e\n\n\u003cBODY\u003e\n\n\u003ch1 class=\"title\"\u003eReadme.html taken from build/GAIANDB_V2.1.8_20160523.zip\u003c/h1\u003e\n\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch2 class=\"nocount\"\u003eContents\u003c/h2\u003e\n\u003col class=\"nest\"\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents8\"\u003eWhat is the Gaian Database ?\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents10\"\u003eKey benefits - what does Gaian give you ?\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents12\"\u003eWhat's new in version 2\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents160\"\u003eInstallation and First Steps\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents162\"\u003eUpgrading Gaian\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents165\"\u003eInstallation Prerequisites\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents337\"\u003eSupported Operating Systems\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents168\"\u003eFirst Steps\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents169\"\u003eVerify the installation\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents52\"\u003eQuick table federation examples (matching a Logical Table to a Physical One)\u003c/a\u003e\n\t\t\u003col class=\"nest\"\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents53\"\u003eFederate an RDBMS table\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents60\"\u003eFederate an existing CSV File\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents201\"\u003eFederate an existing Excel spreadsheet\u003c/a\u003e\u003c/li\u003e\n\t\t\u003c/ol\u003e\n\t\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"WorkedExamples.html\"\u003eFurther worked examples\u003c/a\u003e\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents110\"\u003eGaianDB Usage\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents115\"\u003eGaianDB node usage\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents120\"\u003eLaunching multiple GaianDB nodes\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents127\"\u003eLaunching a GaianDB node from a separate directory\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents130\"\u003eHow to specify a location for configuration and log files and the physical database folder\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents137\"\u003eHow to manage multiple GaianDB node executions with multiple working directories\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents138\"\u003eHow to initialise a GaianDB node with User defined Derby objects like Tables, views, procedures,functions\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents139\"\u003eHow to integrate GaianDB into a wrapping class or framework: startup, start detection, kill\u003c/a\u003e\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents339\"\u003eClient Usage\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents140\"\u003eCommand line processor options with 'queryDerby'\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents145\"\u003eIssuing Distributed SQL Queries\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents341\"\u003eDistributed Sub-queries or Pushing query processing to each node\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents217\"\u003eListing server warnings\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents344\"\u003eDashboard Graphical User Interface\u003c/a\u003e\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents175\"\u003eConfiguration\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents343\"\u003eUsing the Configuration File\u003c/a\u003e\n\t\t\u003col class=\"nest\"\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents180\"\u003eConfiguration file: Properties for Logical Tables, their Data Sources and associated Connections\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents209\"\u003eConfiguration file: Global System properties and identifiers\u003c/a\u003e\u003c/li\u003e\n\t\t\u003c/ol\u003e\n\t\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents177\"\u003eUsing the management API to apply configuration updates\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents67\"\u003ePluralized data sources\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents66\"\u003eIn-Memory tables and indexes on their columns\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents92\"\u003eConstant Column definitions\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents64\"\u003eUsing the LISTQUERIES and CANCELQUERY procedures as well as the GDB_TIMEOUT and GDB_WID features\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents65\"\u003eConnection maintenance configuration in intermittent/high latency/low bandwidth networks\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents215\"\u003eHard-wiring connections between GaianDB nodes (incl setting up gateways)\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents99\"\u003eText file federation configuration options (e.g: how to specify different record and field separators)\u003c/a\u003e\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents306\"\u003eSecurity\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents307\"\u003eCommunication encryption using SSL (Secure Sockets Layer)\u003c/a\u003e\n\t\t\u003col class=\"nest\"\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents3071\"\u003eServer Configuration for SSL\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents3072\"\u003eClient Setup for SSL\u003c/a\u003e\u003c/li\u003e\n\t\t\u003c/ol\u003e\n\t\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents308\"\u003eUser authentication\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents309\"\u003eUser access restriction to chosen databases\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents310\"\u003ePassword scrambling\u003c/a\u003e\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents315\"\u003eAdvanced Features\u003c/a\u003e\n\t\u003col class=\"nest\"\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents321\"\u003eSpecial SQL Query Options (with_provenance, explain, maxDepth, ...)\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents234\"\u003eProvenance Columns: Special columns identifying origin of data rows\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents270\"\u003eExplain Queries: Getting and showing the route of a query\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents273\"\u003eSpecifying advanced table and column mappings\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents274\"\u003eSQL Query as a Logical Table Data Source\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents275\"\u003eMessage Storer: Message Broker Integration (e.g. use with sensors)\u003c/a\u003e\u003c/li\u003e\n\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents401\"\u003eCustom VTIs\u003c/a\u003e\n\t\t\u003col class=\"nest\"\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents402\"\u003eIBM Content Analytics Restful Interface (ICAREST)\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli class=\"nest\"\u003e\u003ca href=\"#contents403\"\u003eSpatial Query\u003c/a\u003e\u003c/li\u003e\n\t\t\u003c/ol\u003e\n\t\u003c/li\u003e\n\t\u003c/ol\u003e\n\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents325\"\u003eSupported RDBMS Data sources\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents330\"\u003eSupported SQL Types for Logical Tables Definitions\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents335\"\u003eSupported Number of Logical Tables\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents346\"\u003eError Messages\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents359\"\u003eFAQ \u0026 Troubleshooting\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents121\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\u003cbr/\u003e\n\u003cli class=\"nest\"\u003e\u003ca href=\"#contents400\"\u003eAuthors/Contacts\u003c/a\u003e\u003c/li\u003e\n\n\u003c/ol\u003e\n\n\n\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents8\"\u003eWhat is the Gaian Database ?\u003c/a\u003e\u003c/h2\u003e\n\n\u003cp\u003eThe Gaian Database - or GaianDB for short - is a lightweight (\u0026lt;4MB) dynamically distributed federated database (DDFD) engine based on Apache Derby 10.x. It provides a single centralized view over multiple, heterogeneous back-end data sources (e.g. RDBMS dbs, files, text indexes, spreadsheets, etc.) using an extensible logical table abstraction layer. However, its principal feature is its ability to automatically discover and federate other GaianDB instances (federating nodes) such that a whole network of these can be automatically formed.\u003c/p\u003e\n\u003cbr/\u003e\n\u003ccenter\u003e\n\u003cTABLE class='image'\u003e\n   \u003cTR class='image'\u003e\n     \u003cTD class='image'\u003e\u003ca Href=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb3.gif\"\u003e\n          \u003cimg src=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb3.gif\" width=500\u003e\n\t  \u003c/a\u003e\u003c/TD\u003e\n     \u003cTD class='image'\u003e\u003ca Href=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb1.gif\"\u003e\n          \u003cimg src=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb1.gif\"\u003e\u003c/a\u003e\u003c/TD\u003e\n\t  \u003c/TR\u003e\n   \u003cTR class='image'\u003e\n     \u003cTD  class='image' align='center'\u003eFig. 1 - GaianDB high level architecture\u003c/TD\u003e\n     \u003cTD  class='image' align='center'\u003eFig. 2 - GaianDB connectivity model\u003c/TD\u003e\n    \u003c/TR\u003e\n\u003c/TABLE\u003e\n\u003c/center\u003e\n\n\u003cp\u003eGaianDB advocates a flexible 'store locally, query anywhere' (SLQA) paradigm, which means the data remains where it is, but you have a centralized view over which you can query. Each data source should have its data managed autonomously and applications can choose which sections of it to make available to the GaianDB network. For this reason distributed insert/update/delete operations are not currently supported.\u003c/p\u003e\n\u003cp\u003eQueries can be injected at any node and are routed effectively around the network using a 'biologically inspired' connectivity model that strives to minimise query time and maximise efficiency (by minimising network diameter and maximising connections to the fittest nodes).\u003c/p\u003e\n\u003cp\u003eArchitecturally, GaianDB sits \u003cb\u003eunderneath\u003c/b\u003e Derby, and is invoked by Derby to process any GaianDB-specific SQL. To query GaianDB you typically identify the 'GaianTable' class (which references a logical table, similar to a view definition), or the 'GaianQuery' class (which references an embedded subquery), either of which will retrieve federated data from every GaianDB node in a connected network. Other GaianDB SQL usage may be invocations of one of the stored procedures or functions that make up GaianDB's system management API. These can be used to define Logical Tables and their federated Data Sources, relational database connections, user-defined Gaian Connections (for nodes that couldn't be discovered), or any of GaianDB's general system properties individually.\u003c/p\u003e\n\u003cbr /\u003e\n\u003cp\u003eThe distributed, federated and store-local nature of GaianDB makes it extremely scalable and suitable for a wide variety of deployments and scenarios. Also, GaianDB is 100% Java and so it can run in a multitude of places; anywhere from small devices, like mobile phones, to large enterprise systems; easily integrating between all of these.\u003c/p\u003e\n\u003cp\u003eGaianDB has already been used in the context of complex text analytics applications, performing distributed semantic join queries, and drawn the attention of significant customers in the military space.\u003c/p\u003e\n\u003cp\u003eAs a DDFD technology, its positioning is shown below:\u003c/p\u003e\n\n\u003cbr/\u003e\n\u003ccenter\u003e\n\u003cTABLE class='image'\u003e\n   \u003cTR class='image'\u003e\n     \u003cTD class='image'\u003e\u003ca Href=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb5.gif\"\u003e\u003cimg src=\"https://github.com/gaiandb/gaiandb/blob/master/doc/UserDocs/images/gaiandb5.gif\" \u003e\u003c/a\u003e\u003c/TD\u003e\n     \u003c/TR\u003e\n   \u003cTR class='image'\u003e\n     \u003cTD class='image' align='center'\u003eFig. 3 - GaianDB positioning\u003c/TD\u003e\n     \u003c/TR\u003e\n\u003c/TABLE\u003e\n\u003c/center\u003e\n\n\u003cbr/\u003e\n\u003cp\u003eGaianDB also offers a wide range of other features such as: Dynamic re-configuration; an 'Explain' network-route query option; In-Memory tables and indexing; Message Broker integration; contextual meta-data.\u003c/p\u003e\n\u003cp\u003eFor more information on GaianDB, take a look at this recently (2008) published paper:\n\u003ca href=\"http://www.usukita.org/files/Page238.pdf\"\u003eA Dynamic Distributed Federated Database\u003c/a\u003e\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents10\"\u003eKey benefits - what does Gaian give you ?\u003c/a\u003e\u003c/h2\u003e\n\u003cbr/\u003e\nGaian federation technology provides a \"data virtualisation\" layer - with many beneficial aspects:\n\u003cp/\u003e\n\n\u003col\u003e\n\u003cli\u003eReduced Maintenance\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eUsing simplified abstract data model as opposed to full physical data model for each back-end\u003c/li\u003e\n\t\u003cli\u003eViews do not need to be created in back-end databases\u003c/li\u003e\n\t\u003cli\u003eData sets from separate providers can be joined with SQL + configuration only (no need for code)\u003c/li\u003e\n\t\u003cli\u003eMany types of data-sources are supported out-of-the-box (including RDBMS tables, structured text files or XL spreadsheets)\u003c/li\u003e\n\t\u003cli\u003eOther data-sources can be exposed via a Gaian Java plugin interface wrapper.\u003c/li\u003e\n\t\u003cli\u003eSimplified model for Migrating/swapping underlying data-sources - only requires configuration updates.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eIn-line SQL transformation of data records\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eAd-hoc simple data cleansing\u003c/li\u003e\n\t\u003cli\u003eData matching\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eReal-time data\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eGaian provides access to current endpoint data - as opposed to \"old\" data exported by data owner.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eData Ownership\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eGaian nodes can be attributed to each data owner.\u003c/li\u003e\n\t\u003cli\u003eData owners provide/deny access to their data as they wish - Graphical/intuitive tools for this are in development.\u003c/li\u003e\n\t\u003cli\u003eIntermediary data stores for published data are no longer required.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eDistributed Access + Scalability\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eA plurality of interconnected Gaian nodes provides the ability to connect and query through any node.\u003c/li\u003e\n\t\u003cli\u003eNodes can be configured differently to allow access to more or less data structures.\u003c/li\u003e\n\t\u003cli\u003eGaian networks can provide scalability by attributing distinct data set partitions to different Gaian instances.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eDistributed Processing\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eDistributed queries can result in parallel processing, e.g. invoking procedure calls (can also be used to implement map/reduce).\u003c/li\u003e\n\t\u003cli\u003eProcessing functions can be deployed dynamically (in a JAR file). Gaian does not need restarting.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eProvenance\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eGaian provides provenance information for every data record.\u003c/li\u003e\n\t\u003cli\u003eThis facilitates development of Governance aspects which can also be applied at the Gaian layer.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003ePolicy\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eAccess rules can be implemented to cover access to all data providers (incl. files etc) in one place.\u003c/li\u003e\n\t\u003cli\u003ePolicy functions can be deployed dynamically (in a JAR file). Gaian does not need to be restarted.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003eCaching\u003c/li\u003e\n\u003cul\u003e\n\t\u003cli\u003eGaian can act as a cache location for pre-processed results, faster access, etc\u003c/li\u003e\n\t\u003cli\u003eGaian can also host surrogate key tables for linking different datasets together (e.g. same locations expressed in different languages)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ol\u003e\n\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents12\"\u003eWhat's new in version 2\u003c/a\u003e\u003c/h2\u003e\n\u003cUL\u003e\n\t\u003cli\u003eNew features\u003c/li\u003e\n\t\u003cul\u003e\n    \u003cli\u003eUpdated Derby pre-req to version 10.8.3.1.1505077\u003c/li\u003e\n    \u003cli\u003eQuery timeout and cancellation capabilities\u003c/li\u003e\n    \u003cli\u003eSupport for batched record filtering for access to high-latency authentication systems.\u003c/li\u003e\n    \u003cli\u003eExtended ICAREST + SpatialQuery VTIs such that they call out to the policy plugin to enforce required filtering.\u003c/li\u003e\n    \u003cli\u003eNew TRANSIENT option ** Deprecated in favour of PLURALIZED ** allows in-memory data sources definitions, thus speeding up their registration and avoiding having to remove them on start-up.\u003c/li\u003e\n    \u003cli\u003eImproved capability to integrate Gaian in a wrapping JVM process (e.g. OSGi framework) - with start detection, termination handling and workspace configuration.\u003c/li\u003e\n    \u003cli\u003eAllowed sub-queries to include stored procedure calls and CRUD operations.\u003c/li\u003e\n    \u003cli\u003eNew capability to target sub-queries at specific nodes.\u003c/li\u003e\n    \u003cli\u003eAdded expiry capability to INMEMORY caching option.\u003c/li\u003e\n    \u003cli\u003eImproved core capability to distinguish ordinary from delimited identifiers; and eliminated need for column naming in sub-queries.\u003c/li\u003e\n    \u003cli\u003eAdded capability to connect and authenticate using a separate user database or schema whilst retaining access to all GaianDB logical tables and procedures/functions.\u003c/li\u003e\n    \u003cli\u003eNew query path visualisation in dashboard - ability to discover loaded logical tables and paths to them.\u003c/li\u003e\n    \u003cli\u003ePluralized data sources for accessing multiple data source end-points through a single Gaian data source wrapper - e.g. a set of files in a folder.\u003c/li\u003e\n    \u003cli\u003ePolicy framework improvements: Now passes cluster ID and session user ID to allow more control over user and query access.\u003c/li\u003e\n    \u003cli\u003eNew API batch update capability with procedure: setconfigproperties().\u003c/li\u003e\n    \u003cli\u003eCapability to restrict user access to designated derby databases, see shipped derby.properties.\u003c/li\u003e\n    \u003cli\u003eAuto-resoltuion of schemas and column-mappings for custom VTIs\u003c/li\u003e\n    \u003cli\u003eGeneric pooling of all data source wrappers - now includes custom VTIs\u003c/li\u003e\n\t\u003c/ul\u003e\n\t\u003cli\u003eBug fixes\u003c/li\u003e\n\t\u003cul\u003e\n    \u003cli\u003eFixed and improved reliability of Excel data source wrapper\u003c/li\u003e\n    \u003cli\u003eImproved persisted caching behaviour when handling expensive join queries\u003c/li\u003e\n    \u003cli\u003eSimplified logical table reload when nodes connect or disconnect\u003c/li\u003e\n    \u003cli\u003eImproved policy plugin framework to allow GaianDB to call out to the plugin at any stage in the query life cycle in future.\u003c/li\u003e\n    \u003cli\u003eReduced GaianNode startup time and improved reliability of refresh of logical table views and stored procedures.\u003c/li\u003e\n    \u003cli\u003eFixed propagation of query meta-data information (such as user credentials) so it is only sent with GaianDB queries and can now reach endpoint data sources via sub-queries.\u003c/li\u003e\n    \u003cli\u003eImproved robustness of discovery capability and fixed local discovery for MAC OS X.\u003c/li\u003e\n    \u003cli\u003eMade policy framework generically extensible without impacting on backwards compatibility in future.\u003c/li\u003e\n    \u003cli\u003eFixed/improved resilience to concurrent configuration updates, reducing risk of corruption to the configuration file.\u003c/li\u003e\n    \u003cli\u003eImproved reliability and cross-platform capability of start-up and kill scripts.\u003c/li\u003e\n    \u003cli\u003eFixed intermittent hang and deadlock issues.\u003c/li\u003e\n    \u003cli\u003eIncreased size of all VARCHAR input parameters of APIs to maximum size 32672 chars.\u003c/li\u003e\n    \u003cli\u003eImproved resolution of file paths on Windows for structured text file data sources.\u003c/li\u003e\n    \u003cli\u003eFixed OutOfMemoryError related to long running queries - by ignoring hanging suspects which are not inter-node connections (as these cannot be polled anyway), clearing executing data sources after a query. Also added logging for memory reporting.\u003c/li\u003e\n    \u003cli\u003eFixed intermittent GaianDB inter-node connection hiccups during discovery\u003c/li\u003e\n    \u003cli\u003eFixed run status when the main GaianNode thread completes such that it can subsequently be re-started\u003c/li\u003e\n    \u003cli\u003eFixed inconsistent state after a REMOVELT() causing issues with subsequent SETDSXXX().\u003c/li\u003e\n    \u003cli\u003eFixed GaianNode shutdown() to complete despite issues, removing use of Thread.isAlive(), and only when Derby has shut down - thus allowing a clean restart.\u003c/li\u003e\n    \u003cli\u003eRemoved use of System.gc() calls when releasing cached rows for JOINs.\u003c/li\u003e\n    \u003cli\u003eFixed logical table table creation issues with full synchronization of SETXXX() API calls.\u003c/li\u003e\n    \u003cli\u003ePerformance improvement with logical table API updates by avoiding checks on unaffected tables.\u003c/li\u003e\n    \u003cli\u003eResolved issues with IS [NOT] NULL construct against Gaian VTIs and Table Functions.\u003c/li\u003e\n    \u003cli\u003eFixed issue whereby a data source pointing to an RDBMS table expression would not load after being changed (throwing a StringIndexOutOfBoundsException).\u003c/li\u003e\n    \u003cli\u003eImproved resilience to issues with logical table view reloads such that subsequent view reloads are not impacted.\u003c/li\u003e\n    \u003cli\u003eFixed condition whereby GaianDB at rest having Oracle data source consumes its cursors until failure.\u003c/li\u003e\n    \u003cli\u003eCleaner error reporting when GAIANDB.jar cannot be found on startup.\u003c/li\u003e\n    \u003cli\u003eChanged condition for DROP statements which raised silent derby.log ERRORs, e.g. at startup.\u003c/li\u003e\n    \u003cli\u003eFixed issue with CACHE tables used for JOIN processing when an logical table definition contains a LONGVARCHAR, by normalising types to Derby syntax.\u003c/li\u003e\n    \u003cli\u003eAvoid Gaian hang when connection to a peer node is abruptly lost, e.g. termination of a peer node's VM\u003c/li\u003e\n    \u003cli\u003eAllow special characters in column names\u003c/li\u003e    \n\t\u003c/ul\u003e\n\t\u003cli\u003ePrototyped - coming soon:\u003c/li\u003e\n\t\u003cul\u003e\n    \u003cli\u003eUDP Driver for inter-node connectivity over UDP\u003c/li\u003e\n    \u003cli\u003e'Lite' Driver to run independantly from Derby (with limited SQL capability)\u003c/li\u003e\n    \u003cli\u003eClient node discovery capability to allow load balancing, e.g. from WAS\u003c/li\u003e\n    \u003cli\u003eNew deployment capability to IBM Bluemix cloud\u003c/li\u003e\n    \u003cli\u003eGeneric access to web services\u003c/li\u003e\n    \u003cli\u003eMongoDB VTI\u003c/li\u003e\n    \u003cli\u003eAccumulo VTI\u003c/li\u003e\n\t\u003c/ul\u003e\n\u003c/UL\u003e\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents20\"\u003eVersion 2.1.4\u003c/a\u003e\u003c/h3\u003e\n\u003cUL\u003e\n\t\u003cli\u003eNew features\u003c/li\u003e\n\t\u003cul\u003e\n    \u003cli\u003eDynamic class-loading of newly deployed JAR libraries containing JDBC drivers, policy code, and data source connectors (VTIs).\u003c/li\u003e\n    \u003cli\u003ePolicy framework improvements: Now receives full-sub-query for pass-through queries, and ResultSetMetaData is supplemented with table names of queried columns.\u003c/li\u003e\n    \u003cli\u003eNew capability to enable Derby's SSL encryption for client-server and inter-node connections.\u003c/li\u003e\n    \u003cli\u003eNew procedure RUNSQL() to run SQL directly against any specified connection ID or JDBC properties specified directly.\u003c/li\u003e\n    \u003cli\u003eNew capability to specify \u0026lt;GAIAN_WORKSPACE\u0026gt; tag in _ARGS property of a Text file DS.\u003c/li\u003e\n    \u003cli\u003eNew procedures LISTTHREADS() to list Gaian's JVM threads; and LISTENV() to list Gaian's system environment properties.\u003c/li\u003e\n\t\u003c/ul\u003e\n\t\u003cli\u003eBug fixes\u003c/li\u003e\n\t\u003cul\u003e\n\t\u003cli\u003eFixed condition leading to a Derby NullPointerException occurring with 4-way (or higher complexity) self-joins.\u003c/li\u003e\n    \u003cli\u003eFixed queryDerby behaviour (e.g. with delimiters, comments) to be consistent across all modes: file, query-list, interactive\u003c/li\u003e\n    \u003cli\u003eFixed lookup of control files for structured text file data sources (e.g. CSV)\u003c/li\u003e\n    \u003cli\u003eRDBMS types normalisation for Oracle data types - particularly INTERVAL type and TIMESTAMP types involving a TIME ZONE.\u003c/li\u003e\n    \u003cli\u003eResolved OutOfMemoryError occurring from accumulated stale objects after repeated runs of a query.\u003c/li\u003e\t\n\t\u003c/ul\u003e\n\t\u003cli\u003ePrototyping in progress - coming soon:\u003c/li\u003e\n\t\u003cul\u003e\n\t\u003cli\u003eWindows Service for Gaian - with documentation for registry changes required\u003c/li\u003e\n    \u003cli\u003eGaianServlet for deploying Gaian as a webapp\u003c/li\u003e\n    \u003cli\u003eGaian in Bluemix\u003c/li\u003e\n    \u003cli\u003eGenericWS connector hardening for access to a web service as a data source\u003c/li\u003e\n\t\u003c/ul\u003e\n\u003c/UL\u003e\n\u003cbr/\u003e\n\n\n\n\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents160\"\u003eInstallation and First Steps\u003c/a\u003e\u003c/h2\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents162\"\u003eUpgrade Gaian\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf you are already using GaianDB, and want to upgrade please refer to the \u003ca href=\"UpgradeGaian.html\"\u003eupgrade instructions\u003c/a\u003e.\u003c/p\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents165\"\u003eInstallation Prerequisites\u003c/a\u003e\u003c/h3\u003e\n\u003cul\u003e\n\t\u003cli\u003eJava JRE version: IBM JRE 1.7.0 or above. (Oracle JRE 1.7.0 should work; GNU versions of Java have caused problems). Make sure that the 'java' executable is in your PATH.\u003c/li\u003e\n\t\u003cbr/\u003e\n\t\u003cli\u003eAny RDBMS JDBC drivers required to connect to and federate your Relational Database tables. These will often\n\tbe included in the installation package for the RDBMS.\n\t\u003cbr/\u003e\n\tTo make a new JDBC driver available to GaianDB, add the JAR file that contains the driver class to the Java CLASSPATH\n\tvariable before starting GaianDB (for convenience, the Java CLASSPATH is defined in 'launchGaianServer.bat(/.sh)' batch and script files).\n\t\u003cbr/\u003e\n\t\u003cp\u003eGaianDB only supports the official JDBC drivers provided by the Relational Database providers listed below:\u003c/p\u003e\n\t\u003ctable class='data'\u003e\n\t\t\t\u003cthead\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\u003cth width=\"101\" height=\"30\"\u003e\u003cb\u003eName\u003c/b\u003e\u003c/th\u003e\n\t\t\t\t\u003cth height=\"30\" width=\"169\"\u003e\u003cb\u003eJar file(s)\u003c/b\u003e\u003c/th\u003e\n\t\t\t\t\u003cth height=\"30\" width=\"314\"\u003e\u003cb\u003eJDBC driver class\u003c/b\u003e\u003c/th\u003e\n\t\t\t\t\u003cth height=\"30\" width=\"429\"\u003e\u003cb\u003eURL connection template\u003c/b\u003e\u003c/th\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003c/thead\u003e\n\t\t\u003ctbody\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\u003cth height=\"43\" width=\"101\"\u003eDB2\u003c/th\u003e\t\t\t\t\n\t\t\t\t\u003ctd height=\"43\" width=\"169\"\u003edb2jcc.jar, db2jcc_licence_cu.jar\u003c/td\u003e\n\t\t\t\t\u003ctd height=\"43\" width=\"314\"\u003ecom.ibm.db2.jcc.DB2Driver\u003c/td\u003e\n\t\t\t\t\u003ctd height=\"43\" width=\"429\"\u003ejdbc:db2://\u0026lt;server\u0026gt;:\u0026lt;port50000\u0026gt;/\u0026lt;database\u0026gt;\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr class='odd'\u003e\n\t\t\t\t\u003cth width=\"101\" height=\"43\"\u003eSQLServer\u003c/th\u003e\n\t\t\t\t\u003ctd width=\"169\" height=\"43\"\u003esqljdbc4.jar\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"314\" height=\"43\"\u003ecom.microsoft.sqlserver.jdbc.SQLServerDriver\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"429\" height=\"43\"\u003ejdbc:sqlserver://\u0026lt;server\u0026gt;:\u0026lt;port1433\u0026gt;;DatabaseName=\u0026lt;database\u0026gt;\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\u003cth width=\"101\" height=\"43\"\u003eMySQL\u003c/th\u003e\n\t\t\t\t\u003ctd width=\"240\" height=\"43\"\u003emysql-connector-java-5.1.7-bin.jar\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"314\" height=\"43\"\u003ecom.mysql.jdbc.Driver\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"429\" height=\"43\"\u003ejdbc:mysql://\u0026lt;server\u0026gt;:\u0026lt;port3306\u0026gt;/\u0026lt;database\u0026gt;\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr class='odd'\u003e\n\t\t\t\t\u003cth width=\"101\" height=\"43\"\u003eOracle\u003c/th\u003e\n\t\t\t\t\u003ctd width=\"169\" height=\"43\"\u003eojdbc14.jar or ojdbc6.jar\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"314\" height=\"43\"\u003eoracle.jdbc.OracleDriver\u003c/td\u003e\n\t\t\t\t\u003ctd width=\"429\" height=\"43\"\u003ejdbc:oracle:thin:@\u0026lt;server\u0026gt;:\u0026lt;port3306\u0026gt;/\u0026lt;database\u0026gt;\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\u003c/tbody\u003e\n\t\u003c/table\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\u003cp\u003eKnowledge of SQL. All SQL conventions that apply to Apache Derby apply to the IBM Gaian Database. See \u003ca href=\"http://db.apache.org/derby/docs/10.5/ref/\"\u003eApache Derby's Reference Manual\u003c/a\u003e for more information.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents337\"\u003eSupported Operating Systems\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eGaianDB has primarily been tested on RHEL, Ubuntu, Windows and MAC OS X. The documentation uses the term 'Unix' to refer to Linux and MAC OS X. \n   GaianDB should work on other Unix systems (AIX, HP-UX, Solaris, etc ..) and was demonstrated running on many virtualization engines (VMWare,KVM,Xen) and Cloud software (IBM SmartCloud Provisioning (SCP), Amazon EC2, OpenStack), but no testing has been done.\u003c/p\u003e\n\u003cp\u003eWindows and Unix scripts are provided in the installation for starting a GaianDB server ('launchGaianServer.bat' \u0026amp; 'launchGaianServer.sh') and running the Command Line Processor ('queryDerby.bat' \u0026amp; 'queryDerby.sh').\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e All paths, whether on Windows or Unix, should use forward slashes (/) and not backslashes (\\).\u003c/p\u003e\n\u003cp\u003eWhen launching a GaianDB node, the system must be able to resolve its own hostname to an IP address. You can check this by:\u003c/p\u003e\n\u003cul\u003e\n\t\u003cli\u003eYou can find out what the server's hostname is by running the\n\t'hostname' command in a command prompt.\u003c/li\u003e\n\t\u003cli\u003eTest whether the system can resolve its own IP address using\n\tthe 'ping \u0026lt;hostname\u0026gt;' command (valid for Unix and Windows).\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIf it cannot:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eCheck whether your firewall is blocking the requests. For more information on configuring firewalls for use with GaianDB, please refer to the \u003ca href=\"#contents359\"\u003eFAQ \u0026 Troubleshooting\u003c/a\u003e section. \u003c/li\u003e\n\u003cli\u003eCheck your network settings:\n\u003cul\u003e\n\t\u003cli\u003eFor Windows systems:\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003eCheck your\n\tnetwork connection's IP configuration properties (Control Panel-\u003eNetwork Connections-\u003eSelect a connection-\u003e\n\tright click, Properties-\u003eInternet protocol). \u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\u003c/li\u003e\n    \u003cli\u003eFor Unix systems:\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003eCheck that the file /etc/hosts has a line (otherwise add one)\n\t\t\tin the format: \u0026lt;ipaddress\u0026gt; \u0026lt; hostname\u0026gt;\n\t\t\t\u0026lt;hostname.domain\u0026gt;\u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\u003c/li\u003e\n\t  \u003cli\u003eFor virtualization software and systems:\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003eCheck that the network layer exposes the proper IP addresses and allows the IP and UDP traffic through as described above. \n\t\t\t    You may be required to use NAT instead of BRIDGE for instance. \u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents168\"\u003eFirst Steps\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003e\u003cb\u003eInstall Gaian\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eTo 'install' GaianDB, simply unzip the zip install file to a directory of your choice. (For instance 'C:\\GaianDB' on Windows or '/home/myuser/GaianDB' on Unix)\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eLaunch a GaianDB Node\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eYou are now ready to launch a GaianDB node. To do so,  run 'launchGaianServer.bat' on Windows or './launchGaianServer.sh' on Unix.\u003c/p\u003e\n\u003cp\u003eBy default, the GaianDB node will start a Derby server listening on port 6414 and use the properties file 'gaiandb_config.properties' in the local directory.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eExamine the default configuration\u003c/b\u003e\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\nTo see the default startup settings for a GaianDB node, take a look at the USAGE statement. You can see this by running the launch scripts and passing in any unrecognised argument, e.g: '-?' , '-help' or '-usage'. For example, from a command prompt, by running 'launchGaianServer.bat -help' on Windows or './launchGaianServer.sh -help' on Unix.  \n\u003c/li\u003e\n\u003cli\u003e\nHave a look at the configuration file 'gaiandb_config.properties'. This defines logical tables (LT0, LT1, ..), and their federated physical data sources (LT0_DS0, LT0_DS1, ..). You can find out more about these configuration settings \u003ca href=\"#contents175\"\u003ehere\u003c/a\u003e.\n\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents169\"\u003eVerify the installation\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eTo quickly test that GaianDB is up and running:\u003c/p\u003e\n\u003cul\u003e\u003cli\u003eRun 'testGaianDB.bat' on Windows or './testGaianDB.sh' on Unix. This launches a sample query against the sample LT0 logical table, which should retrieve \u0026amp; display the records from the CSV flat file found at: '\u0026lt;GaianDB Install Directory\u0026gt;/csvtestfiles/datafile.dat'.\u003c/li\u003e\u003c/ul\u003e\n\n\u003cp\u003eYou can also run other queries against GaianDB using the \u003ca href=\"#contents140\"\u003eCommand Line Processor\u003c/a\u003e or \u003ca href=\"#contents344\"\u003eDashboard Graphical User Interface\u003c/a\u003e client utilities.\nFor example, you can use to the Command Line Processor to run 'select' commands or run some of the stored procedures the GaianDB provides to verify the installation is correct, as follows:\u003c/p\u003e\n\u003col\u003e\n\t\u003cli\u003e\n\t\tRun 'queryDerby.bat' on Windows or './queryDerby.sh' on Unix.\n\t\t\u003cbr\u003eOnce the the Command Line Processor is ready to receive commands you will see: \u003cpre\u003esql\u003e\u003c/pre\u003e\n\t\u003c/li\u003e\u003cbr\u003e\n\t\u003cli\u003e\n\t\tTo query a GaianDB logical table, use the syntax: 'select \u003ci\u003exxx\u003c/i\u003e from LT0 where ...' where LT0 is the name of a logical table defined in the 'gaiandb_config.properties'.\n\t\t\u003cbr\u003eFor example you can type:\u003cpre\u003eselect * from LT0\u003c/pre\u003e\n\t\u003c/li\u003e\u003cbr\u003e\n\t\u003cli\u003eTo execute the stored procedure API calls use the following:\n\t\t\u003cul\u003e\n\t\t\u003cli\u003e\u003cpre\u003ecall listspfs()\u003c/pre\u003e- lists all defined stored procedures and functions.\u003c/li\u003e\n\t\t\u003cli\u003e\u003cpre\u003ecall listlts()\u003c/pre\u003e- lists all defined Logical Tables.\u003c/li\u003e\n\t\t\u003cli\u003e\u003cpre\u003ecall listds() \u003c/pre\u003e- lists all Data Sources federated by all logical tables.\u003c/li\u003e\n\t\t\u003cli\u003e\u003cpre\u003ecall listrdbc()\u003c/pre\u003e- lists all active (i.e. that have an attached data source) relational database connections\u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\u003c/li\u003e\n\u003c/ol\u003e\n\u003cbr/\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents52\"\u003eQuick table federation examples (matching a Logical Table to a Physical One)\u003c/a\u003e\u003c/h3\u003e\n\n\u003cul style=\"margin-top:1em;\"\u003e\n\t\u003cli\u003e\u003ca href=\"#contents53\"\u003eFederate an RDBMS table\u003c/a\u003e\u003c/li\u003e\n\t\u003cli\u003e\u003ca href=\"#contents60\"\u003eFederate an existing CSV File\u003c/a\u003e\u003c/li\u003e\n\t\u003cli\u003e\u003ca href=\"#contents201\"\u003eFederate an existing Excel spreadsheet\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eFor each example, first start a GaianDB node (see \u003ca href=\"#contents168\"\u003eFirst Steps\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThen, when the server has started, run 'queryDerby.bat' on Windows or './queryDerby.sh' on Unix to start a Command Line Processor connected to the GaianDB server.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e You can also use the \u003ca href=\"#contents344\"\u003eDashboard Graphical User Interface\u003c/a\u003e client utility to perform these examples.\u003c/p\u003e\n\u003chr\u003e\u003ch4\u003e\u003ca name=\"contents53\"\u003eFederate an RDBMS table\u003c/a\u003e\u003c/h4\u003e\n\u003cp\u003e\nIn this quick example we will show you how to federate an existing RDBMS table using GaianDB. For this we will use the DB2 sample table 'employee'; please refer to the \u003ca href=\"http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fr0001934.htm\"\u003eDB2 documentation for how to install the sample tables\u003c/a\u003e.\n\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003ca name=\"contents54\"\u003eList all the active Relational Database Connections to see the current state of the GaianDB node:\u003c/a\u003e\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e call listrdbc()\ncall listrdbc()\n============================================================================================================================================\nGDB_NODE        |CID             |CDRIVER                                       |CURL                                 |CUSR                |\n============================================================================================================================================\nL3R3844         |LOCALDERBY      |org.apache.derby.jdbc.EmbeddedDriver          |jdbc:derby:gaiandb;create=true       |gaiandb             |\nL3R3844         |mysql5          |com.mysql.jdbc.Driver                         |jdbc:mysql://localhost:3306/test     |root                |\n============================================================================================================================================\nFetched 2 rows. Total Time: 47ms (Execution Time: 47ms)\n\nsql\u003e\n\u003c/pre\u003e\n\u003cbr/\u003e\u003cli\u003e\u003ca name=\"contents55\"\u003eCreate a new Relational Database Connection.\u003c/a\u003e\u003cbr /\u003e\nTo do this we use the GaianDB stored procedure \u003ccode\u003esetrdbc(...)\u003c/code\u003e with a connection id of 'db2conn' and the driver \u0026 url as shown below (unless your DB2 instance is running on a different machine or port). Enter your own user name and password for DB2 in place of the last 2 arguments.\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e call setrdbc('db2conn', 'com.ibm.db2.jcc.DB2Driver', 'jdbc:db2://localhost:50000/sample', 'DavidVyvyan', '???????')\ncall setrdbc('db2conn', 'com.ibm.db2.jcc.DB2Driver', 'jdbc:db2://localhost:50000/sample', 'DavidVyvyan', '???????')\n\nsql\u003e\n\u003c/pre\u003e\n\n\u003cbr /\u003e\u003cli\u003e\u003ca name=\"contents56\"\u003eSetup a Logical Table that includes all columns of the 'employee' table and federates it.\u003c/a\u003e\u003cbr /\u003e\nTo do this we use the GaianDB stored procedure \u003ccode\u003esetltforrdbtable(\u0026lt;New Logical Table Name\u0026gt;, \u0026lt;Database Connection\u0026gt;, \u0026lt;Selection Predicate\u0026gt;)\u003c/code\u003e. For example:\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e call setltforrdbtable('db2employee', 'db2conn', 'employee')\ncall setltforrdbtable('db2employee', 'db2conn', 'employee')\n\nsql\u003e\n\u003c/pre\u003e\nWhere:\n\u003cul\u003e\n\u003cli\u003e'db2employee' is the new logical table name.\u003c/li\u003e\n\u003cli\u003e'db2conn' designates the RDBMS connection we just created.\u003c/li\u003e\n\u003cli\u003e'employee' matches the entire 'employee' table.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eNOTE: The DB2 driver classes must be on the CLASSPATH in launchGaianServer.bat.\u003c/p\u003e\n\n\u003cbr /\u003e\u003cli\u003e\u003ca name=\"contents57\"\u003eQuery the new Logical Table.\u003c/a\u003e\u003cbr /\u003e\nTo do this you can simply issue a standard SQL SELECT query on the table 'db2employee'. For example:\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e select * from db2employee\nselect * from db2employee\n========================================================================================================================================================\nEMPNO |FIRSTNME    |MIDINIT|LASTNAME       |WORKDEPT|PHONENO|HIREDATE  |JOB     |EDLEVEL|SEX|BIRTHDATE |SALARY     |BONUS      |COMM       |NODEINDEX  |\n========================================================================================================================================================\n000010|CHRISTINE   |I      |HAAS           |A00     |3978   |1995-01-01|PRES    |     18|F  |1963-08-24|  152750.00|    1000.00|    4220.00|          1|\n000020|MICHAEL     |L      |THOMPSON       |B01     |3476   |2003-10-10|MANAGER |     18|M  |1978-02-02|   94250.00|     800.00|    3300.00|          1|\n000030|SALLY       |A      |KWAN           |C01     |4738   |2005-04-05|MANAGER |     20|F  |1971-05-11|   98250.00|     800.00|    3060.00|          1|\n000050|JOHN        |B      |GEYER          |E01     |6789   |1979-08-17|MANAGER |     16|M  |1955-09-15|   80175.00|     800.00|    3214.00|          1|\n000060|IRVING      |F      |STERN          |D11     |6423   |2003-09-14|MANAGER |     16|M  |1975-07-07|   72250.00|     500.00|    2580.00|          1|\n000070|EVA         |D      |PULASKI        |D21     |7831   |2005-09-30|MANAGER |     16|F  |2003-05-26|   96170.00|     700.00|    2893.00|          1|\n000090|EILEEN      |W      |HENDERSON      |E11     |5498   |2000-08-15|MANAGER |     16|F  |1971-05-15|   89750.00|     600.00|    2380.00|          1|\n000100|THEODORE    |Q      |SPENSER        |E21     |0972   |2000-06-19|MANAGER |     14|M  |1980-12-18|   86150.00|     500.00|    2092.00|          1|\n000110|VINCENZO    |G      |LUCCHESSI      |A00     |3490   |1988-05-16|SALESREP|     19|M  |1959-11-05|   66500.00|     900.00|    3720.00|          1|\n000120|SEAN        |       |O'CONNELL      |A00     |2167   |1993-12-05|CLERK   |     14|M  |1972-10-18|   49250.00|     600.00|    2340.00|          1|\n000130|DELORES     |M      |QUINTANA       |C01     |4578   |2001-07-28|ANALYST |     16|F  |1955-09-15|   73800.00|     500.00|    1904.00|          1|\n000140|HEATHER     |A      |NICHOLLS       |C01     |1793   |2006-12-15|ANALYST |     18|F  |1976-01-19|   68420.00|     600.00|    2274.00|          1|\n000150|BRUCE       |       |ADAMSON        |D11     |4510   |2002-02-12|DESIGNER|     16|M  |1977-05-17|   55280.00|     500.00|    2022.00|          1|\n000160|ELIZABETH   |R      |PIANKA         |D11     |3782   |2006-10-11|DESIGNER|     17|F  |1980-04-12|   62250.00|     400.00|    1780.00|          1|\n000170|MASATOSHI   |J      |YOSHIMURA      |D11     |2890   |1999-09-15|DESIGNER|     16|M  |1981-01-05|   44680.00|     500.00|    1974.00|          1|\n000180|MARILYN     |S      |SCOUTTEN       |D11     |1682   |2003-07-07|DESIGNER|     17|F  |1979-02-21|   51340.00|     500.00|    1707.00|          1|\n000190|JAMES       |H      |WALKER         |D11     |2986   |2004-07-26|DESIGNER|     16|M  |1982-06-25|   50450.00|     400.00|    1636.00|          1|\n000200|DAVID       |       |BROWN          |D11     |4501   |2002-03-03|DESIGNER|     16|M  |1971-05-29|   57740.00|     600.00|    2217.00|          1|\n000210|WILLIAM     |T      |JONES          |D11     |0942   |1998-04-11|DESIGNER|     17|M  |2003-02-23|   68270.00|     400.00|    1462.00|          1|\n000220|JENNIFER    |K      |LUTZ           |D11     |0672   |1998-08-29|DESIGNER|     18|F  |1978-03-19|   49840.00|     600.00|    2387.00|          1|\n000230|JAMES       |J      |JEFFERSON      |D21     |2094   |1996-11-21|CLERK   |     14|M  |1980-05-30|   42180.00|     400.00|    1774.00|          1|\n000240|SALVATORE   |M      |MARINO         |D21     |3780   |2004-12-05|CLERK   |     17|M  |2002-03-31|   48760.00|     600.00|    2301.00|          1|\n000250|DANIEL      |S      |SMITH          |D21     |0961   |1999-10-30|CLERK   |     15|M  |1969-11-12|   49180.00|     400.00|    1534.00|          1|\n000260|SYBIL       |P      |JOHNSON        |D21     |8953   |2005-09-11|CLERK   |     16|F  |1976-10-05|   47250.00|     300.00|    1380.00|          1|\n000270|MARIA       |L      |PEREZ          |D21     |9001   |2006-09-30|CLERK   |     15|F  |2003-05-26|   37380.00|     500.00|    2190.00|          1|\n000280|ETHEL       |R      |SCHNEIDER      |E11     |8997   |1997-03-24|OPERATOR|     17|F  |1976-03-28|   36250.00|     500.00|    2100.00|          1|\n000290|JOHN        |R      |PARKER         |E11     |4502   |2006-05-30|OPERATOR|     12|M  |1985-07-09|   35340.00|     300.00|    1227.00|          1|\n000300|PHILIP      |X      |SMITH          |E11     |2095   |2002-06-19|OPERATOR|     14|M  |1976-10-27|   37750.00|     400.00|    1420.00|          1|\n000310|MAUDE       |F      |SETRIGHT       |E11     |3332   |1994-09-12|OPERATOR|     12|F  |1961-04-21|   35900.00|     300.00|    1272.00|          1|\n000320|RAMLAL      |V      |MEHTA          |E21     |9990   |1995-07-07|FIELDREP|     16|M  |1962-08-11|   39950.00|     400.00|    1596.00|          1|\n000330|WING        |       |LEE            |E21     |2103   |2006-02-23|FIELDREP|     14|M  |1971-07-18|   45370.00|     500.00|    2030.00|          1|\n000340|JASON       |R      |GOUNOT         |E21     |5698   |1977-05-05|FIELDREP|     16|M  |1956-05-17|   43840.00|     500.00|    1907.00|          1|\n200010|DIAN        |J      |HEMMINGER      |A00     |3978   |1995-01-01|SALESREP|     18|F  |1973-08-14|   46500.00|    1000.00|    4220.00|          1|\n200120|GREG        |       |ORLANDO        |A00     |2167   |2002-05-05|CLERK   |     14|M  |1972-10-18|   39250.00|     600.00|    2340.00|          1|\n200140|KIM         |N      |NATZ           |C01     |1793   |2006-12-15|ANALYST |     18|F  |1976-01-19|   68420.00|     600.00|    2274.00|          1|\n200170|KIYOSHI     |       |YAMAMOTO       |D11     |2890   |2005-09-15|DESIGNER|     16|M  |1981-01-05|   64680.00|     500.00|    1974.00|          1|\n200220|REBA        |K      |JOHN           |D11     |0672   |2005-08-29|DESIGNER|     18|F  |1978-03-19|   69840.00|     600.00|    2387.00|          1|\n200240|ROBERT      |M      |MONTEVERDE     |D21     |3780   |2004-12-05|CLERK   |     17|M  |1984-03-31|   37760.00|     600.00|    2301.00|          1|\n200280|EILEEN      |R      |SCHWARTZ       |E11     |8997   |1997-03-24|OPERATOR|     17|F  |1966-03-28|   46250.00|     500.00|    2100.00|          1|\n200310|MICHELLE    |F      |SPRINGER       |E11     |3332   |1994-09-12|OPERATOR|     12|F  |1961-04-21|   35900.00|     300.00|    1272.00|          1|\n200330|HELENA      |       |WONG           |E21     |2103   |2006-02-23|FIELDREP|     14|F  |1971-07-18|   35370.00|     500.00|    2030.00|          1|\n200340|ROY         |R      |ALONZO         |E21     |5698   |1997-07-05|FIELDREP|     16|M  |1956-05-17|   31840.00|     500.00|    1907.00|          1|\n========================================================================================================================================================\nFetched 42 rows. Total Time: 219ms (Execution Time: 172ms)\n\nsql\u003e\n\u003c/pre\u003e\n\u003cp\u003eThis contains all columns from the physical table 'employee' and also an example constant column 'NODEINDEX' to identify which GaianDB node the information is from. For more info on constant columns, refer to \u003ca href=\"#contents92\"\u003ethis section\u003c/a\u003e.\u003c/p\u003e\n\n\u003cbr /\u003e\u003cli\u003e\n\u003ca name=\"contents58\"\u003eList the active RDBMS connections and data sources to verify updates.\u003c/a\u003e\u003cbr /\u003e\nTo do this we use two GaianDB stored procedures: \u003cbr /\u003e\u003cbr /\u003e\n\u003cul\u003e\n    \u003cli\u003e\n    \u003ccode\u003elistrdbc()\u003c/code\u003e - this shows the active RDBMS connections of every connected GaianDB node (the only node in the example below is L3R3844).\u003cpre\u003e\nsql\u003e\nsql\u003e call listrdbc()\ncall listrdbc()\n============================================================================================================================================\nGDB_NODE        |CID             |CDRIVER                                       |CURL                                 |CUSR                |\n============================================================================================================================================\nL3R3844         |LOCALDERBY      |org.apache.derby.jdbc.EmbeddedDriver          |jdbc:derby:gaiandb;create=true       |gaiandb             |\nL3R3844         |mysql5          |com.mysql.jdbc.Driver                         |jdbc:mysql://localhost:3306/test     |root                |\nL3R3844         |DB2CONN         |com.ibm.db2.jcc.DB2Driver                     |jdbc:db2://localhost:50000/sample    |DavidVyvyan         |\n============================================================================================================================================\nFetched 3 rows. Total Time: 47ms (Execution Time: 16ms)\n\nsql\u003e\n\u003c/pre\u003e\u003c/li\u003e\n    \u003cli\u003e\n    \u003ccode\u003elistds()\u003c/code\u003e -  this shows all the active data sources of every connected GaianDB node.\n\u003cpre\u003e\nsql\u003e call listds()\ncall listds()\n=====================================================================================================================================================================================\nGDB_NODE        |DSID                |DSTYPE|DSWRAPPER           |DSHANDLE                                                                               |DSOPTIONS                 |\n=====================================================================================================================================================================================\nL3R3844         |DB2SALES_DS0        |R     |tk:1                |jdbc:db2://localhost:50000/sample::sales                                               |-                         |\nL3R3844         |LT1_DS0             |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::TABLE1                                                 |-                         |\nL3R3844         |LT0_DS0             |V     |InMemoryRows:1      |./csvtestfiles/datafile.dat                                                            |INMEMORY                  |\nL3R3844         |DB2EMPLOYEE_DS0     |R     |InMemoryRows:1      |jdbc:db2://localhost:50000/sample::employee where firstnme \u003e 'T'                       |INMEMORY INDEX ON FIRSTNME|\nL3R3844         |DF2_DSDATAFILE2     |V     |FileImport:1        |./csvtestfiles/datafile2.dat                                                           |-                         |\nL3R3844         |MYSQLLT_DSCARS      |R     |InMemoryRows:1      |jdbc:mysql://localhost:3306/test::cars                                                 |INMEMORY                  |\nL3R3844         |DERBY_TABLES_DSLOC  |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::sys.systables,sys.syscolumns where tableid=referenceid |-                         |\n=====================================================================================================================================================================================\nFetched 7 rows. Total Time: 62ms (Execution Time: 46ms)\nsql\u003e\n\u003c/pre\u003e\n\n\u003cp\u003e\nThe data source id (DSID) is a composite name which has as prefix of the logical table name to which it is attached.\nOther columns denote:\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ctable class=\"data\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003cth\u003eColumn Name\u003c/th\u003e\u003cth\u003eDescription\u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eDSTYPE\u003c/td\u003e\u003ctd\u003eData source type (e.g. R for RDBMS, V for Virtual Table)\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eDSWRAPPER\u003c/td\u003e\u003ctd\u003e\nWrapping class and the number of pool instances in memory.\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eDSHANDLE\u003c/td\u003e\u003ctd\u003e\nPhysical source handle descriptor (e.g data source filename or db url+table name)\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eDSOPTIONS\u003c/td\u003e\u003ctd\u003e\nData source options list. This currently only describes whether the data source is held in memory and, if so, any index that might be defined on one of its columns.\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cbr/\u003e\u003cli\u003e\u003ca name=\"contents59\"\u003eFederate only a portion of the 'employee' table by using a selection predicate on it.\u003c/a\u003e\u003cbr /\u003e\nHere we will pass a more complex selection predicate to the \u003ccode\u003esetltforrdbtable(...)\u003c/code\u003e stored procedure so that only matching records from the 'employee' table are federated.\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e call setltforrdbtable('db2employee', 'db2conn', 'employee where firstnme \u003e ''T''')\ncall setltforrdbtable('db2employee', 'db2conn', 'employee where firstnme \u003e ''T''')\n\nsql\u003e\nsql\u003e select * from db2employee\nselect * from db2employee\n========================================================================================================================================================\nEMPNO |FIRSTNME    |MIDINIT|LASTNAME       |WORKDEPT|PHONENO|HIREDATE  |JOB     |EDLEVEL|SEX|BIRTHDATE |SALARY     |BONUS      |COMM       |NODEINDEX  |\n========================================================================================================================================================\n000100|THEODORE    |Q      |SPENSER        |E21     |0972   |2000-06-19|MANAGER |     14|M  |1980-12-18|   86150.00|     500.00|    2092.00|          1|\n000110|VINCENZO    |G      |LUCCHESSI      |A00     |3490   |1988-05-16|SALESREP|     19|M  |1959-11-05|   66500.00|     900.00|    3720.00|          1|\n000210|WILLIAM     |T      |JONES          |D11     |0942   |1998-04-11|DESIGNER|     17|M  |2003-02-23|   68270.00|     400.00|    1462.00|          1|\n000330|WING        |       |LEE            |E21     |2103   |2006-02-23|FIELDREP|     14|M  |1971-07-18|   45370.00|     500.00|    2030.00|          1|\n========================================================================================================================================================\nFetched 4 rows. Total Time: 31ms (Execution Time: 15ms)\n\nsql\u003e\nsql\u003e\n\u003c/pre\u003e\n\u003cp\u003eThese selection predicates can be very complex. For example, you could use one to federate the result of a join between two tables.\u003c/p\u003e\n\u003c/ol\u003e\n\n\n\u003chr\u003e\u003ch4\u003e\u003ca name=\"contents60\"\u003eFederate an existing CSV File\u003c/a\u003e\u003c/h4\u003e\n\u003cp\u003e\nIn this quick example we will show you how to federate an existing CSV flat file using GaianDB. For this we will use the file found at '\u0026lt;GaianDB Install Directory\u0026gt;/csvtestfiles/datafile3.dat'.\n\u003c/p\u003e\n\u003cp\u003e\nNote that GaianDB's FileImport VTI can read many different file formats, not just CSV.\nThe record and field separators and other 'control parameters' such as these may be altered using a 'control file'. Refer to\n\u003ca href=\"#contents99\"\u003eText file federation configuration options (e.g: how to specify different record and field separators)\u003c/a\u003e for details.\n\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e All paths, whether on Windows or Unix, should use forward slashes (/) and not backslashes (\\).\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003ca name=\"contents61\"\u003eFederate the CSV flat file 'datafile3.dat' as an RDBMS table called 'zzz'.\u003c/a\u003e\u003cbr /\u003e\nTo do this, we call the stored GaianDB procedure \u003ccode\u003esetltforfile(\u0026lt;logical table name\u0026gt;, \u0026lt;file location\u0026gt;)\u003c/code\u003e.\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e call setltforfile('zzz', './csvtestfiles/datafile3.dat')\ncall setltforfile('zzz', './csvtestfiles/datafile3.dat')\n\nsql\u003e\n\u003c/pre\u003e\n\u003cbr/\u003e\u003cli\u003e\u003ca name=\"contents62\"\u003eList data sources to verify that the update was applied.\u003c/a\u003e\u003cbr /\u003e\nTo do this, we call the stored GaianDB procedure \u003ccode\u003elistds()\u003c/code\u003e. \nRefer to the\n\u003ca href=\"#contents58\"\u003eprevious explanation on the columns returned by listrdbc() and listds()\u003c/a\u003e for details on the columns used here.\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e call listds()\ncall listds()\n=========================================================================================================================================================================================\nGDB_NODE            |DSID                |DSTYPE|DSWRAPPER           |DSHANDLE                                                                               |DSOPTIONS                 |\n=========================================================================================================================================================================================\nL3R3844             |DB2SALES_DS0        |R     |tk:1                |jdbc:db2://localhost:50000/sample::sales                                               |-                         |\nL3R3844             |LT1_DS0             |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::TABLE1                                                 |-                         |\nL3R3844             |LT0_DS0             |V     |InMemoryRows:1      |./csvtestfiles/datafile.dat                                                            |INMEMORY                  |\nL3R3844             |DB2EMPLOYEE_DS0     |R     |InMemoryRows:1      |jdbc:db2://localhost:50000/sample::employee where firstnme \u003e 'T'                       |INMEMORY INDEX ON FIRSTNME|\nL3R3844             |ZZZ_DS0             |V     |FileImport:1        |./csvtestfiles/datafile3.dat                                                           |-                         |\nL3R3844             |MYSQLLT_DSCARS      |R     |InMemoryRows:1      |jdbc:mysql://localhost:3306/test::cars                                                 |INMEMORY                  |\nL3R3844             |DERBY_TABLES_DSLOC  |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::sys.systables,sys.syscolumns where tableid=referenceid |-                         |\n=========================================================================================================================================================================================\nFetched 7 rows. Total Time: 31ms (Execution Time: 0ms)\n\nsql\u003e\n\u003c/pre\u003e\n\u003cp\u003eIf it was successful, you should see an entry with a DSID of 'ZZZ_DS0' and a DSHANDLE of './csvtestfiles/datafile3.dat'.\u003c/p\u003e\n\n\u003cbr/\u003e\u003cli\u003e\u003ca name=\"contents63\"\u003eQuery the new Logical Table.\u003c/a\u003e\u003cbr /\u003e\nTo do this you can simply issue a standard SQL SELECT query on the table 'zzz'. For example:\u003c/li\u003e\n\u003cpre\u003e\nsql\u003e\nsql\u003e select * from zzz\nselect * from zzz\n====================================================================================================================================================================================\nCOLUMN1           |COLUMN2               |COLUMN3             |COLUMN4             |COLUMN5             |COLUMN6             |COLUMN7             |COLUMN8             |NODEINDEX  |\n====================================================================================================================================================================================\n2                 |YYYYYYYYYYY2222222222 |62                  |35                  |17                  |10                  |122                 |65.6                |          1|\n91                |BLAHBLAH              |3                   |2                   |44                  |35                  |0                   |2.1                 |          1|\n9                 |SHG*\u0026^22datafile3     |62                  |35                  |17                  |10                  |122                 |65.6                |          1|\n9                 |FFFFFFFFFFFK2222222222|62                  |35                  |17                  |10                  |122                 |65.6                |          1|\n====================================================================================================================================================================================\nFetched 4 rows. Total Time: 16ms (Execution Time: 16ms)\n\nsql\u003e\nsql\u003e\n\u003c/pre\u003e\n\u003cp\u003eThis contains all columns from the CSV file and also an example constant column 'NODEINDEX' to identify which GaianDB node the information is from. For more info on constant columns, refer to \u003ca href=\"#contents92\"\u003ethis section\u003c/a\u003e.\u003c/p\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\u003ch4\u003e\u003ca name=\"contents201\"\u003eFederate an existing Excel spreadsheet\u003c/a\u003e\u003c/h4\u003e\n\n\u003cp\u003eIn this quick example we will show you how to federate an existing Excel spreadsheet using GaianDB. For this we will use the spreadsheet found at '\u0026lt;GaianDB Install Directory\u0026gt;/exceltestfiles/address.xls'.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e All paths, whether on Windows or Unix, should use forward slashes (/) and not backslashes (\\).\u003c/p\u003e\n\u003col\u003e\n\t\u003cli\u003e\n\t\t\u003ca name=\"contents202\"\u003e Prerequisites\u003c/a\u003e\n\t\t\u003cp\u003e\n\t\tIf you wish to perform this example, you will require the POI libraries (version 3.6 or above) for manipulating Microsoft Documents from the \u003ca href=\"http://poi.apache.org/download.html\"\u003eApache POI website\u003c/a\u003e. If you are happy to accept the license terms, you can choose to download the binary distributions. The necessary jar files are:\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003e poi-XX.jar \u003c/li\u003e\n\t\t\t\u003cli\u003e poi-ooxml-XX.jar \u003c/li\u003e\n\t\t\t\u003cli\u003e poi-ooxml-schemas-XX.jar \u003c/li\u003e\n\t\t\t\u003cli\u003e dom4j-XX.jar \u003c/li\u003e\n\t\t\t\u003cli\u003e geronimo-stax-api_XX.jar (or stax-api-xx.jar in some versions of POI)\u003c/li\u003e\n\t\t\t\u003cli\u003e xmlbeans-XX.jar \u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\t\u003c/p\u003e\n\t\t\u003cp\u003e\n\t\tWhere XX is the version number.\n\t\tThese jars would need to be placed into the GaianDB lib directory and then added to the GaianDB classpath as follows:\u003c/p\u003e\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003e On Windows, edit the 'launchGaianServer.bat' file (right click -\u003e edit). \u003c/li\u003e\n\t\t\t\u003cli\u003e Add the following lines :\n\t\t\t \u003cpre\u003e\nrem Apache - POI jars for spreadsheet federation\nSET CLASSPATH=%CLASSPATH%;%GDBL%\\geronimo-stax-api_XX.jar;%GDBL%\\poi-ooxml-schemas-XX.jar;%GDBL%\\dom4j-XX.jar;%GDBL%\\poi-XX.jar;%GDBL%\\poi-ooxml-XX.jar;%GDBL%\\xmlbeans-XX.jar\n\t\t\t \u003c/pre\u003e\n\t\t\t\u003c/li\u003e\n\t\t\t\u003cli\u003e On Unix, edit the 'launchGaianServer.sh' file. \u003c/li\u003e\n\t\t\t\u003cli\u003e Add the following lines :\n\t\t\t \u003cpre\u003e\n# Apache - POI jars for spreadsheet federation\nexport CLASSPATH=\"$CLASSPATH:$GDBL/geronimo-stax-api_XX.jar:$GDBL/poi-ooxml-schemas-XX.jar:$GDBL/dom4j-XX.jar:$GDBL/poi-XX.jar:$GDBL/poi-ooxml-XX.jar:$GDBL/xmlbeans-XX.jar\"\n                          \u003c/pre\u003e\n                        \u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\t\u003cp\u003eIf you had already started the GaianDB by using the launchGaianServer script, you will need to stop the node and restart it for the new changes to be taken into account.\n\t\tTo stop GaianDB, you can either close the command window on Windows, or use Ctrl-C on Unix or use the killGaianServer script.\n\t\tWhen starting multiple nodes, you will need to use the killGaianServers script to stop them all.\u003c/p\u003e\n\t\u003c/li\u003e\n\n\t\u003cbr/\u003e\n\t\u003cli\u003e\n\t\t\u003ca name=\"contents203\"\u003e\n\t\tFederate the Excel spreadsheet 'Sheet1' from the file 'address.xls' as an RDBMS table.\u003c/a\u003e\u003cbr /\u003eTo do this, we use the GaianDB stored procedure \u003ccode\u003esetltforexcel(...)\u003c/code\u003e:\n\t\u003c/li\u003e\n\n\t\u003cpre\u003e\nsql\u003e\nsql\u003e call setltforexcel('lsheet1', 'exceltestfiles/address.xls,Sheet1')\ncall setltforexcel('lsheet1', 'exceltestfiles/address.xls,Sheet1')\n\nsql\u003e\n\t\u003c/pre\u003e\n\n\tYou can also federate a part of the spreadsheet by defining a range :\n\n\t\u003cpre\u003e\nsql\u003e\nsql\u003e call setltforexcel('lsheet2', 'exceltestfiles/address.xls,Sheet1,A1,D7')\ncall setltforexcel('lsheet2', 'exceltestfiles/address.xls,Sheet1,A1,D7')\n\nsql\u003e\n\t\u003c/pre\u003e\n\n\tBy default, the values of the first row are used as the column names for the federated table. However, if the first row does not contain the column names, you can add 'false' to the parameters to have the column names automatically generated; in the form \u003ci\u003eCOLUMN1\u003c/i\u003e, \u003ci\u003eCOLUMN2\u003c/i\u003e, \u003ci\u003eCOLUMN\u0026lt;n\u0026gt;\u003c/i\u003e:\n\n\t\u003cpre\u003e\nsql\u003e\nsql\u003e call setltforexcel('lsheet3', 'exceltestfiles/address.xls,Sheet1,A5,D7,false')\ncall setltforexcel('lsheet3', 'exceltestfiles/address.xls,Sheet1,A5,D7,false')\n\nsql\u003e\n\t\u003c/pre\u003e\n\n\t\u003cbr/\u003e\n\t\u003cli\u003e\n\t\t\u003ca name=\"contents204\"\u003e\n\t\tList data sources to verify that the update was applied.\u003c/a\u003e\u003cbr /\u003e To do this, we call the stored GaianDB procedure \u003ccode\u003elistds()\u003c/code\u003e. Refer to the \u003ca href=\"#contents58\"\u003e previous explanation on the columns returned by listrdbc() and listds()\u003c/a\u003e for details on the columns used here.\n\t\u003c/li\u003e\n\t\u003cpre\u003e\nsql\u003e\nsql\u003e call listds()\ncall listds()\n===============================================================================================================================================================================\nGDB_NODE    |DSID                |DSTYPE|DSWRAPPER         |DSHANDLE                                                                               |DSOPTIONS                 |\n===============================================================================================================================================================================\nL3R3844     |DB2SALES_DS0        |R     |tk:1              |jdbc:db2://localhost:50000/sample::sales                                               |-                         |\nL3R3844\t    |LSHEET1_DS0         |V     |-                 |address.xls,Sheet1                                                                     |-                         |\nL3R3844     |LSHEET2_DS0         |V     |-                 |address.xls,Sheet1,A:1,D:7                                                             |-                         |\nL3R3844     |LT1_DS0             |R     |EmbedStatement:1  |jdbc:derby:gaiandb;create=true::TABLE1                                                 |-                         |\nL3R3844     |LT0_DS0             |V     |InMemoryRows:1    |./csvtestfiles/datafile.dat                                                            |INMEMORY                  |\nL3R3844     |DB2EMPLOYEE_DS0     |R     |InMemoryRows:1    |jdbc:db2://localhost:50000/sample::employee where firstnme \u003e 'T'                       |INMEMORY INDEX ON FIRSTNME|\nL3R3844     |ZZZ_DS0             |V     |FileImport:1      |./csvtestfiles/datafile3.dat                                                           |-                         |\nL3R3844     |MYSQLLT_DSCARS      |R     |InMemoryRows:1    |jdbc:mysql://localhost:3306/test::cars                                                 |INMEMORY                  |\nL3R3844     |DERBY_TABLES_DSLOC  |R     |EmbedStatement:1  |jdbc:derby:gaiandb;create=true::sys.systables,sys.syscolumns where tableid=referenceid |-                         |\n===============================================================================================================================================================================\nFetched 7 rows. Total Time: 31ms (Execution Time: 0ms)\n\t\u003c/pre\u003e\n\n\t\u003cbr/\u003e\n\t\u003cli\u003e\n\t\t\u003ca name=\"contents205\"\u003eQuery the new Logical Tables.\u003c/a\u003e\u003cbr /\u003eTo do this you can simply issue a standard SQL SELECT query against the 'LSheet1', 'LSheet2' and 'LSheet3' tables. For example:\n\t\u003c/li\u003e\n\n\t\u003cpre\u003e\nsql\u003e select * from LSheet1\nselect * from LSheet1\n================================================================================================\nLAST        |FIRST          |ADDRESS                    |CITY            |STATE    |ZIP        |\n================================================================================================\nBuffet      |Jimmy          |Somewhere on the Beach     |KeyWest         |FL       |      33040|\nBush        |George         |1600 Pennsylvania Ave      |Washington      |DC       |      20500|\nCartman     |Eric           |84 Bigboned Way            |South Park      |CO       |      84214|\nCrockett    |Davey          |The Alamo                  |San Antonio     |TX       |      78210|\nDoe         |Jane           |821 Zimbabwe Ave           |Washington      |DC       |      20021|\nGates       |Bill           |1 Microsoft Way            |Redmond         |WA       |      98052|\nJefferson   |George         |194 Deelux Apartments      |In the Sky      |NY       |      10041|\nKong        |King           |Empire State Building      |New York        |NY       |      10118|\nMunster     |Herman         |1313 Mockingbird Lane      |Fargo           |ND       |      58102|\nRockne      |Knute          |146 Keenan Hall            |Notre Dame      |IN       |      46556|\nSimpson     |Homer          |742 Evergreen Terrace      |Springfield     |US       |      12345|\nSmith       |Bob            |12 Main Street             |Anytown         |IN       |      46001|\n================================================================================================\nFetched 12 rows. Total Time: 62ms (Execution Time: 31ms)\n\u003c/pre\u003e\n\u003cpre\u003e\nsql\u003e select * from LSheet2\nselect * from LSheet2\n==========================================================================\nLAST        |FIRST          |ADDRESS                    |CITY            |\n==========================================================================\nBuffet      |Jimmy          |Somewhere on the Beach     |KeyWest         |\nBush        |George         |1600 Pennsylvania Ave      |Washington      |\nCartman     |Eric           |84 Bigboned Way            |South Park      |\nCrockett    |Davey          |The Alamo                  |San Antonio     |\nDoe         |Jane           |821 Zimbabwe Ave           |Washington      |\nGates       |Bill           |1 Microsoft Way            |Redmond         |\n==========================================================================\nFetched 6 rows. Total Time: 46ms (Execution Time: 15ms)\n\u003c/pre\u003e\n\u003cpre\u003e\nsql\u003e select * from LSheet3\nselect * from LSheet3\n==========================================================================\nCOLUMN1     |COLUMN2        |COLUMN3                    |COLUMN4         |\n==========================================================================\nCrockett    |Davey          |The Alamo                  |San Antonio     |\nDoe         |Jane           |821 Zimbabwe Ave           |Washington      |\nGates       |Bill           |1 Microsoft Way            |Redmond         |\n==========================================================================\nFetched 3 rows. Total Time: 63ms (Execution Time: 47ms)\n\u003c/pre\u003e\nYou can use predicates to filter the view even further. \u003cb\u003eNote\u003c/b\u003e: in the example below we have to use \"\" around the word LAST as it is an SQL keyword.\nPutting the \"\" specifies that this should be taken as a string and hence a column name and now as the SQL keyword.\nHere we select entries where the last name starts with the letters from C to Z in alphabetical order.\n\u003cpre\u003e\nsql\u003e select * from lsheet1 where \"LAST\" \u003e 'C'\nselect * from lsheet1 where \"LAST\" \u003e 'C'\n==========================================================================================================\nLAST        |FIRST          |ADDRESS                    |CITY             |STATE    |ZIP        |COLUMN7 |\n==========================================================================================================\nCartman     |Eric           |84 Bigboned Way            |South Park       |CO       |      84214|-       |\nCrockett    |Davey          |The Alamo                  |San Antonio      |TX       |      78210|-       |\nDoe         |Jane           |821 Zimbabwe Ave           |Washington       |DC       |      20021|-       |\nGates       |Bill           |1 Microsoft Way            |Redmond          |WA       |      98052|-       |\nJefferson   |George         |194 Deelux Apartments      |In the Sky       |NY       |      10041|-       |\nKong        |King           |Empire State Building      |New York         |NY       |      10118|-       |\nMunster     |Herman         |1313 Mockingbird Lane      |Fargo            |ND       |      58102|-       |\nRockne      |Knute          |146 Keenan Hall            |Notre Dame       |IN       |      46556|-       |\nSimpson     |Homer          |742 Evergreen Terrace      |Springfield      |US       |      12345|-       |\nSmith       |Bob            |12 Main Street             |Anytown          |IN       |      46001|-       |\n==========================================================================================================\nFetched 10 rows. Total Time: 59ms (Execution Time: 55ms)\n\u003c/pre\u003e\n\n\u003cp\u003eIf you wish, you can also add another Excel file as a Data Source to one of the logical tables created above. Here we select row 2 and 3 to be added to LSheet3.\nSo LSheet3 will now have a view of rows: 2,3 and 5,6,7. \n\u003cpre\u003e\nsql\u003e call setdsexcel('lsheet3', '1', 'exceltestfiles/address.xls,Sheet1,A2,D3,false','MAP_COLUMNS_BY_POSITION', '')\ncall setdsexcel('lsheet3', '1', 'exceltestfiles/address.xls,Sheet1,A2,D3,false','MAP_COLUMNS_BY_POSITION', '')\u003c/pre\u003e\nBelow we can see how the new data source has been linked to the logical table:\n\u003cpre\u003e\nsql\u003e call listds()\ncall listds()\n=================================================================================================================================================================================\nGDB_NODE    |DSID                |DSTYPE|DSWRAPPER           |DSHANDLE                                                                               |DSOPTIONS                 |\n=================================================================================================================================================================================\nL3R3844     |DB2SALES_DS0        |R     |tk:1                |jdbc:db2://localhost:50000/sample::sales                                               |-                         |\nL3R3844\t    |LSHEET1_DS0         |V     |-                   |address.xls,Sheet1                                                                     |-                         |\nL3R3844     |LSHEET2_DS0         |V     |-                   |address.xls,Sheet1,A:1,D:7                                                             |-                         |\nL3R3844     |LSHEET3_DS0         |V     |-                   |address.xls,Sheet1,A5,D7,false                                                         |-                         |\nL3R3844     |LSHEET3_DS1         |V     |-                   |address.xls,Sheet1,A2,D3,false                                                         |MAP_COLUMNS_BY_POSITION   |\nL3R3844     |LT1_DS0             |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::TABLE1                                                 |-                         |\nL3R3844     |LT0_DS0             |V     |InMemoryRows:1      |./csvtestfiles/datafile.dat                                                            |INMEMORY                  |\nL3R3844     |DB2EMPLOYEE_DS0     |R     |InMemoryRows:1      |jdbc:db2://localhost:50000/sample::employee where firstnme \u003e 'T'                       |INMEMORY INDEX ON FIRSTNME|\nL3R3844     |ZZZ_DS0             |V     |FileImport:1        |./csvtestfiles/datafile3.dat                                                           |-                         |\nL3R3844     |MYSQLLT_DSCARS      |R     |InMemoryRows:1      |jdbc:mysql://localhost:3306/test::cars                                                 |INMEMORY                  |\nL3R3844     |DERBY_TABLES_DSLOC  |R     |EmbedStatement:1    |jdbc:derby:gaiandb;create=true::sys.systables,sys.syscolumns where tableid=referenceid |-                         |\n=================================================================================================================================================================================\nFetched 9 rows. Total Time: 31ms (Execution Time: 0ms)\n\u003c/pre\u003e\nThere are now more entries in lsheet3.\n\u003cpre\u003e\nsql\u003e select * from lsheet3 order by column1\nselect * from lsheet3 order by column1\n==========================================================================\nCOLUMN1     |COLUMN2        |COLUMN3                    |COLUMN4         |\n==========================================================================\nBuffet      |Jimmy          |Somewhere on the Beach     |KeyWest         |\nBush        |George         |1600 Pennsylvania Ave      |Washington      |\nCrockett    |Davey          |The Alamo                  |San Antonio     |\nDoe         |Jane           |821 Zimbabwe Ave           |Washington      |\nGates       |Bill           |1 Microsoft Way            |Redmond         |\n==========================================================================\nFetched 5 rows. Total Time: 296ms (Execution Time: 294ms)\n\u003c/pre\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents338\"\u003eFurther Examples\u003c/a\u003e\u003c/h3\u003e\n\n\u003cp\u003eFor more examples see the \u003ca href=\"WorkedExamples.html\"\u003eWorked Examples page\u003c/a\u003e.\u003c/p\u003e\u003cbr /\u003e\n\n\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents110\"\u003eGaianDB Usage\u003c/a\u003e\u003c/h2\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents115\"\u003eGaianDB node usage\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eTo launch a GaianDB node, simply run 'launchGaianServer.bat' on Windows or './launchGaianServer.sh' on Unix; which can be found in the GaianDB install directory.\u003c/p\u003e\n\u003cp\u003eThis will start a GaianDB node using the default options.\u003c/p\u003e\n\n\u003cp\u003eTo specify different options at startup, from the command line, simply run the appropriate startup script for your operating system as follows:\u003c/p\u003e\nOn Windows:\n\u003cpre\u003elaunchGaianServer.bat [-n \u0026lt;nodeID\u0026gt;] [-p \u0026lt;gaian node port\u0026gt;] [-c \u0026lt;configuration file name\u0026gt;] [-mt \u0026lt;message storer topic\u0026gt;] [-log \u0026lt;log level\u0026gt;] [-console] [-g \u0026lt;gateways\u0026gt;] [-initscript \u0026lt;sql init file\u0026gt;]\u003c/pre\u003e\nOn Unix:\n\u003cpre\u003e./launchGaianServer.sh [-n \u0026lt;nodeID\u0026gt;] [-p \u0026lt;gaian node port\u0026gt;] [-c \u0026lt;configuration file name\u0026gt;] [-mt \u0026lt;message storer topic\u0026gt;] [-log \u0026lt;log level\u0026gt;] [-console] [-g \u0026lt;gateways\u0026gt;] [-initscript \u0026lt;sql init file\u0026gt;]\u003c/pre\u003e\n\n\u003cp\u003eThe parameters are defined as follows:\u003c/p\u003e\n\u003ctable class=\"data\"\u003e\n\t\u003cthead\u003e\n\t\u003ctr\u003e\n\t\t\u003cth style=\"width:13em;\"\u003eParameter\u003c/th\u003e\n\t\t\u003cth\u003eDefault\u003c/th\u003e\n\t\t\u003cth\u003eDescription\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-n \u0026lt;nodeID\u0026gt;\u003c/td\u003e\n\t\t\u003ctd\u003e\u0026lt;hostname value\u0026gt;\u003c/td\u003e\n\t\t\u003ctd\u003eThe node ID you wish to use. A suffix of ':\u0026lt;port number\u0026gt;' will be appended for all nodes not running on the default port (6414)\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-p \u0026lt;gaian node port\u0026gt;\u003c/td\u003e\n\t\t\u003ctd\u003e6414\u003c/td\u003e\n\t\t\u003ctd\u003eThe TCP port for the GaianDB node to use.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-c \u0026lt;configuration file name\u0026gt;\n\t\t\u003ctd\u003egaiandb_config.properties\n\t\t\u003ctd\u003eThe name of the configuration file for the GaianDB node to use (located in the current working directory).\u003cbr /\u003e\n\t\t\tThe file must have the '.properties' extension and will not be created automatically if it does not exist.\u003cbr /\u003e\n\t\t\tFor more information, please refer to the \u003ca href=\"#contents175\"\u003eConfiguration section\u003c/a\u003e.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-mt \u0026lt;message storer topic\u0026gt;\n\t\t\u003ctd\u003eNone\n\t\t\u003ctd\u003eThe topic for the Message Storer to use.\u003cbr /\u003eFor more information please refer to the \u003ca href=\"#contents275\"\u003eMessage Storer: Message Broker Integration (e.g. use with sensors)\u003c/a\u003e section.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-log \u0026lt;log level\u0026gt;\n\t\t\u003ctd\u003eNone\n\t\t\u003ctd\u003eThe level of logging to use. This can only be one of: [NONE, LESS, MORE, ALL].\u003cbr /\u003e\n\t\tIf NONE, then no logging is performed.\u003cbr /\u003e\n\t\tOtherwise logging is performed to a file in the current working directory. This file will be named 'gaiandb\u0026lt;port\u0026gt;.log' if a port was specified (using -p) or simply 'gaiandb.log' if no port was specified.\u003cbr /\u003e\n\t\t\u003cbr /\u003e\n\t\tThe logging level can otherwise be dynamically updated using the configuration file.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e-console\n\t\t\u003ctd\u003eN/A\n\t\t\u003ctd\u003eIf specified, then the GaianDB node will log to \u003ci\u003eSystem.out\u003c/i\u003e.\u003cbr /\u003e\n\t\tIf used in combination with the -log parameter, then logging will be performed to both \u003ci\u003eSystem.out\u003c/i\u003e and a file.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\u003ctd\u003e-g \u0026lt;gateways\u0026gt;\n\t\t\u003ctd\u003eNone\n\t\t\u003ctd\u003eList of Discovery Gateways. A discovery gateway is a node outside of your subnet that acts as a relay allowing you to join nodes in its network.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\u003ctd\u003e-initscript \u0026lt;sql init file\u0026gt;\n\t\t\u003ctd\u003eNone\n\t\t\u003ctd\u003eFile location of optional custom SQL initialisation script. For example this may setup logical or physical tables; or stored procedures/functions.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eNote: these are all optional and when not provided the default values will be used. Also, ordering is not important.\u003c/p\u003e\n\n\u003cp\u003eTo stop GaianDB, you can either close the command window it was started from, or run the killGaianServers script\u003c/p\u003e\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents120\"\u003eLaunching multiple GaianDB nodes\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eTo launch multiple GaianDB nodes on the same machine, simply run 'launchMultipleNodes.bat' on Windows or './launchMultipleNodes.sh' on Unix; which can be found in the GaianDB install directory.\u003c/p\u003e\n\u003cp\u003eBy default this will kick off 3 GaianDB nodes that respectively use the pre-canned configuration files: 'gaiandb_config.properties', 'gaiandb_config2.properties' and 'gaiandb_config3.properties' in the current working directory.\u003c/p\u003e\n\u003cp\u003eYou can optionally pass in the number of nodes to launch and you may also use the '-sameconfig' flag to request that each node use the default configuration file: 'gaiandb_config.properties', as follows:\u003c/p\u003e\nOn Windows:\n\u003cpre\u003elaunchMultipleNodes.bat [\u0026lt;numnodes\u0026gt; [-sameconfig]]\u003c/pre\u003e\nOn Unix:\n\u003cpre\u003e./launchMultipleNodes.sh [\u0026lt;numnodes\u0026gt; [-sameconfig]]\u003c/pre\u003e\n\u003cp\u003eIf the '-sameconfig' flag is not specified, each new launched node will expect to find a new 'gaiandb_configN.properties' file where N is the index of the launched node.\u003c/p\u003e\n\n\u003cp\u003eTo stop GaianDB, you  will need to run the killGaianServers script.\u003c/p\u003e\n\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents127\"\u003eLaunching a GaianDB node from a separate directory\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eA GaianDB node will use the working directory to lookup its system files, i.e. gaiandb_config.properties, derby.properties, gaiandb.log, derby.log and the local physical derby database 'gaiandb'.\u003c/p\u003e\n\u003cp\u003eHowever this directory does not neccessarily have to be the GaianDB install folder... This means that you can store separate databases/configurations/logs etc for GaianDB in separate folders, \ne.g. one may have tables accessing a DB2 and another may just be a test instance. These would effectively be 'workspace' folders where you can run GaianDB from.\nThis can be very useful in networked file system scenarios where you may have multiple machines all having their own workspace folder, and loading the GaianDB code from a remote \nlocation (which you may also not have write-access to).\u003c/p\u003e\n\u003cp\u003eTo run GaianDB from a separate workspace directory, you just need to set the environment variable GDBH to the GaianDB install folder before launching the 'launchGaianServer' script.\nFor example:\u003c/p\u003e\nOn Windows:\n\u003cpre\u003e\n  set GDBH=\u0026lt;install path\u0026gt;\n  %GDBH%\\launchGaianServer.bat\n\u003c/pre\u003e\nOn Unix:\n\u003cpre\u003e\n  export GDBH=\u0026lt;install path\u0026gt;\n  $GDBH/launchGaianServer.sh\n\u003c/pre\u003e\n\n\u003cp\u003eTo stop GaianDB, you  will need to run the killGaianServers script.\u003c/p\u003e\n\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents130\"\u003eHow to specify a location for configuration and log files and the physical database folder\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eContinuing on the topic above, in some scenarios you may wish to explicitly set the default location of GaianDB's workspace files: \ni.e. gaiandb_config.properties, derby.properties, gaiandb.log, derby.log and the local physical derby database 'gaiandb'\u003c/p\u003e\n\u003cp\u003eThis can be useful in particular if you have wrapped GaianDB in an OSGi framework or some other 'owning process' which has no concept of a working directory for GaianDB.\nTo set the location of these GaianDB workspace files, set the Java system property: 'derby.system.home' to point to it before starting the Gaian Database. Note that the gaiandb\nconfig file location can also be overriden beyond this using the -c option passed to launchGaianServer (or GaianNode class directly).\u003c/p\u003e\n\u003cp\u003eHere's an example where you want to run GaianDB from an independant \"User directory\", referencing a separate \"GaianDB workspace folder\" and \"GaianDB install path\":\u003c/p\u003e\n\n\u003cpre\u003e\n  # Inside \u0026lt;User directory\u0026gt;/launchGaianServer.sh...:\n  export GDBH=\u0026lt;GaianDB install path\u0026gt;\n  java -Xmx128m -Dderby.system.home=\"\u0026lt;GaianDB workspace folder\u0026gt;\" -cp \"$CLASSPATH\" com.ibm.gaiandb.GaianNode $args\n\u003c/pre\u003e\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents137\"\u003eHow to manage multiple GaianDB node executions with multiple working directories\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eWhile not a typical use case, it may sometimes be desirable to run multiple GaianDB nodes on the same computer. For instance, if you are performing testing or for the purposes of resiliency or load balancing.\u003c/p\u003e\n\u003cp\u003eIf you run multiple GaianDB nodes from the same working directory, they will by default share the same configuration file. This may be desirable if every node shares the same logical table definitions and configuration settings. Otherwise, you would need to specify a different configuration file for each node (using the -c parameter, as explained in \u003ca href=\"#contents115\"\u003eGaianDB Server usage\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eA cleaner approach is to have each GaianDB node use it's own working directory; and consequently it's own configuration file. The \u003ca href=\"#contents127\"\u003eLaunching GaianDB from a separate directory\u003c/a\u003e section details how to do this.\u003c/p\u003e\n\u003cp\u003eOne issue to consider when running multiple GaianDB nodes on the same machine is whether there will be any physical resource contention. As an example, a single Derby database will only allow one process to access it directly at any one time and so multiple nodes trying to access it simultaneously will suffer from resource contention and may behave unexpectedly. However, you are unlikely to encounter this kind of issue in typical usage scenarios.\u003c/p\u003e\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents138\"\u003eHow to initialise a GaianDB node with User defined Derby objects like Tables, views, procedures,functions\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIt may be sometimes desirable to initialise the derby database of a GaianDB node with tables, views, index, records, procedures and functions before the Logical tables and datasources are created by GaianDB.\n\u003cp\u003eAn easy implementation is to prime the Derby database before launching the GaianDB as usual. \n   The priming can be linked to the presence of the GaianDB directory.If the directory is not present, that means the GaianDB has not been launched previously and therefore the derby database need to be created and primed.\n   For this,  one can create a copy of the Queryderby.bat  to run a SQL script in standalone derby mode with eventually creation of the Database, with the following lines: \n\u003cP\u003eThe new batch file launchGaianServerWithInit.bat can be modified like the following (on Windows):\n\u003cpre\u003e@echo off\nTITLE Initiliasing the Derby database\n\nif not defined GDBH set GDBH=.\nset GDBL=%GDBH%\\lib\n\nSET CLASSPATH=\"%GDBL%\\;%GDBL%\\GAIANDB.jar;%GDBL%\\db2jcutdown.jar;%GDBL%\\derby.jar;%GDBL%\\derbyclient.jar\"\n\nSET ARGS=%*\n\nREM Run a SQL script only if gaianDB directory doesn't exist.\nIF  EXIST GAIANDBX GOTO DB_ALREADY_INITIALIZED\n      echo  Creating the necessary SQL objects for my application....\n      java -cp \"%CLASSPATH%\" com.ibm.gaiandb.tools.SQLDerbyRunner -td@ -standalone -createdb gaiandb_init2.sql      \n:DB_ALREADY_INITIALIZED\n \nCall launchGaianServer.bat \n\u003c/pre\u003e \n\n\u003cP\u003eThe file gaiandb_init2.sql looks like this below:\n\u003cPRE\u003e\n  -- a set of SQL statements delimited by @ (signs for multiline support)\n  -- and prefixed with ! (for ignoring exceptions:see CLP paragraph in GaianDB documentation)\n  !drop table Mytable@\n  !create table Mytable (a varchar(20), \n                             bb varchar(10),\n                             c int)@\n  !create index i1 on  Mytable(a)@                            \n  !insert into Mytable values ( 'yoya', 'drvy', 23 )@\n  --....more DDL and SQL statements here.... \n\u003c/PRE\u003e\n\u003cp\u003e The output of launchGaianServerWithInit.bat will look something like this the first time:\n\u003cPRE\u003e\n Creating the necessary SQL objects for my application....\nProcessing args: [-td@, -standalone, -createdb, gaiandb_init2.sql]\n\nConnecting to derby database: jdbc:derby:gaiandb;create=true, usr: gaiandb...\n\ndrop table Mytable\nSuppressed Exception: 'DROP TABLE' cannot be performed on 'MYTABLE' because it does not exist.\ncreate table Mytable (a varchar(20), bb varchar(10), c int)\nUpdate count: 0 (Execution Time: 23ms)\n\ninsert into Mytable values ( 'yoya', 'drvy', 23 )\nUpdate count: 1 (Execution Time: 16ms)\n\nLaunching Server...\nPROCESS ID:             101832\nNODE ID:                MYGDBNODE\nWORKING DIRECTORY:      C:\\GAIANDB_Demo\nLOG FILE:               gaiandb.log\nPHYSICAL DATABASE:      gaiandb\nCONFIG FILE:            gaiandb_config.properties\nVERSION INFO:           V2.x - JAR sizes: [640461, 372333], timestamps: [2012/03/14-17:02:12, 2012/03/14-\n17:02:14]\n\nGaianNode started for Derby network server on port: 6414 at Wed Mar 14 17:03:48 GMT 2012\n\nWed Mar 14 17:03:48 GMT 2012: Connections: Maintained to [MYGDBNODE] (seeking 1), Accepted from []\n\u003c/PRE\u003e\n\n\n\n\u003cbr /\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents139\"\u003eHow to integrate GaianDB into a wrapping class or framework: startup, start detection, kill\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eTo integrate GaianDB as an OSGi bundle or as a child 'task' of an owning parent class, you will need to have a means of starting a node, detecting when it has started and stopping it.\u003c/p\u003e\n\u003cp\u003eThis can be done using public methods 'start(\u003cstartupOption\u003e)', 'isStarted()' and 'killNode()' on the GaianNode class in GAIANDB.jar. Here's some sample startup code:\u003c/p\u003e\n\u003cpre\u003e\nString gdbHome = System.getProperty(\"derby.system.home\");\n\nif ( null == gdbHome )\n\tSystem.setProperty( \"derby.system.home\", gdbHome = com.ibm.gaiandb.Util.getInstallPath() );\n\t\t\t\nfinal String[] gaianTaskStartupOptions = new String[] { \"-c\", gdbHome + \"/gaiandb_config.properties\" }; // e.g new String[] { \"-p\", \"6414\", \"-n\", \"MyNodeID\" }\n\nfinal GaianNode gdbNode = new GaianNode();\n\nThread gdbParentThread = new Thread( new Runnable() {\n\tpublic void run() {\n\t\ttry {\n\t\t\tgdbNode.start( gaianTaskStartupOptions );\n\t\t\tSystem.out.println(\"GaianNode parent thread exited cleanly (no Exception)\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"GaianNode parent thread Exception: \" + e);\n\t\t}\n\t}\n});\n\ngdbParentThread.start();\n\nboolean gdbStartupGood = true;\n\nwhile ( gdbNode.isStarted() == false ) {\n\tif ( ! gdbParentThread.isAlive() ) {\n\t\tSystem.out.println(\"GaianNode parent thread has died\");\n\t\tgdbStartupGood = false;\n\t\tbreak;\n\t}\n\tThread.sleep( 100 );\n}\n\u003c/pre\u003e\n\n\n \n\u003cbr /\u003e\u003chr\u003e\u003ch2\u003e\u003ca name=\"contents339\"\u003eClient Usage\u003c/a\u003e\u003c/h2\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents140\"\u003eCommand line processor (CLP) options with 'queryDerby'\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eA command line processor (CLP) client utility is provided with the GaianDB installation. This can be used to run queries on GaianDB and also to issue the GaianDB stored procedures. You can find the CLP in the installation directory and it can be launched by running 'queryDerby.bat' on Windows and 'queryDerby.sh' on Unix.\u003c/p\u003e\n\u003cp\u003eBy default the CLP tries to connect to a local Derby Network server, running on the default GaianDB port: 6414, which is started automatically when a GaianDB node is started.\u003c/p\u003e\n\u003cp\u003eYou can specify different options at startup by launching 'queryDerby' from the command line as follows:\u003c/p\u003e\nOn Windows:\n\u003cpre\u003e\nqueryDerby.bat [-h \u0026lt;host\u0026gt;] [-p \u0026lt;port\u0026gt;] [-usr \u0026lt;usr\u0026gt;] [-pwd \u0026lt;pwd\u0026gt;] [-standalone] [-d \u0026lt;database\u0026gt;] [-createdb] [-nocreatedb] [-repeat \u0026lt;count\u0026gt;] [-tab] [-csv] [-raw] [-csvraw] [-quiet] [-batchprefix \u0026lt;prefix sql\u0026gt;] \u0026lt;sql queries | queries files\u0026gt;*\n\u003c/pre\u003e\nOn Unix:\n\u003cpre\u003e\n./queryDerby.sh [-h \u0026lt;host\u0026gt;] [-p \u0026lt;port\u0026gt;] [-usr \u0026lt;usr\u0026gt;] [-pwd \u0026lt;pwd\u0026gt;] [-standalone] [-d \u0026lt;database\u0026gt;] [-createdb] [-nocreatedb] [-repeat \u0026lt;count\u0026gt;] [-tab] [-csv] [-raw] [-csvraw] [-quiet] [-batchprefix \u0026lt;prefix sql\u0026gt;] \u0026lt;sql queries | queries files\u0026gt;*\n\u003c/pre\u003e\n\u003cp\u003eThe parameters are defined as follows:\u003c/p\u003e\n\u003ctable class=\"data\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eParameter\u003c/th\u003e\n\u003cth\u003eDefault\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-h \u0026lt;host\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\nlocalhost\n\u003c/td\u003e\u003ctd\u003e\nThe host of the GaianDB node to connect to.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-p \u0026lt;port\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\n6414\n\u003c/td\u003e\u003ctd\u003e\nThe port of the GaianDB node to connect to.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-usr \u0026lt;usr\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\ngaiandb\n\u003c/td\u003e\u003ctd\u003e\nThe username to use to connect.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-pwd \u0026lt;pwd\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\npassw0rd\n\u003c/td\u003e\u003ctd\u003e\nThe password to use to connect.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-standalone\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nConnect to Derby directly using the Embedded driver.\u003cbr /\u003e\nThis option is incompatible with any host or port setting.\u003cbr /\u003e\nSubsequently setting the -h or -p parameter will invalidate the setting of this parameter.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-d \u0026lt;database\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\ngaiandb\n(or gaian\u0026lt;port\u0026gt;db, if -p is specified)\n\u003c/td\u003e\u003ctd\u003e\nThe database to connect to.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-createdb\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOn connect, create the database if it doesn't already exist (see -d for which database this will be).\u003cbr /\u003e\n\u003cbr /\u003e\nNote: If a database is created, the default schema will not have been created yet and the shorthand GaianDB views \u0026amp; stored procedures will not be defined. \n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-nocreatedb\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOn connect, do NOT create the database if it doesn't already exist (see -d for which database this will be).\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-repeat \u0026lt;count\u0026gt;\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nSpecifies the number of times any query will be immediately re-issued. i.e. if you set '-repeat 3', then any query you issue will be run 3 times in a row.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-tab\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOutput query results in the default table format which is with table headings and vertical line separators.\u003cbr /\u003e\n\u003cb\u003eThis is the default.\u003c/b\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-csv\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOutput query results in a CSV (comma-separated-values) format.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-raw\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOutput query results as raw data (space-separated) format, with no information or headers.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-csvraw\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nOutput query results as raw data in CSV (comma-separated-values) format, with no information or headers.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-quiet\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nNo output to stdout.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n-batchprefix \u0026lt;prefix sql\u0026gt; \n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nSpecifies an SQL fragment to insert as the prefix to every SQL query batch file passed in on the command line.\u003cbr /\u003e\nSee \u003ca href=\"#contents340\"\u003ehere\u003c/a\u003e for more details.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\u0026lt;sql queries | queries files\u0026gt;*\n\u003c/td\u003e\u003ctd\u003e\n\u003ci\u003eN/A\u003c/i\u003e\n\u003c/td\u003e\u003ctd\u003e\nA space-separated list of SQL queries, or files containing SQL queries, to run immediately on connection.\u003cbr /\u003e\nSee \u003ca href=\"#contents340\"\u003ehere\u003c/a\u003e for more details.\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eIn addition to specifying these parameters when launching 'queryDerby', all flag switches (-h, -p, -usr, etc.) may be entered in the CLP at any time and will take effect immediately.\u003cp\u003e\n\n\u003cp\u003eAs an example, this makes it possible to manage multiple GaianDB nodes from a single window (simply by switching between them using -h and -p). As a special case, note that specifying the -p flag will automatically change the database name to 'gaiandb\u003cport\u003e' (as this is the default database name for a GaianDB node running on a different port). To override this, you can use the '-d' flag to explicitly specify which database name to use.\u003cp\u003e\n\n\u003cp\u003eWhenever query execution fails (for example, because the Derby connection was lost after we changed the 'port' connection value with the '-p' option), the CLP attempts to reconnect automatically: \u003cp\u003e\n\n\u003cpre\u003e\nsql\u003e\nsql\u003e -p 6415\nsql\u003e\nsql\u003e select * from LT0_P\n\nAttempting to re-connect...\n\nConnecting to GAIAN server using url: jdbc:derby://localhost:6415/gaiandb6415;create=false, usr: gaiandb...\n\nConnection attempt succeeded, Re-run query [n/other] ?\n\u003c/pre\u003e\n\n\u003cp\u003eThis is also the case when any Exception occurs during query execution. Although in this case, after recycling the connection, the CLP also automatically runs the stored procedure: \u003ccode\u003ecall listwarnings()\u003c/code\u003e to retrieve and display any recently raised server warnings.\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003ca name=\"contents340\"\u003e\u0026nbsp;\u003c/a\u003e\n\u003cp\u003eWhen launching 'queryDerby', you can pass in a list of SQL queries and/or files containing multiple SQL statements to execute immediately. For example:\u003c/p\u003e\n\nOn Windows:\n\u003cpre\u003e\nqueryDerby.bat \"select * from LT0;select * from LT0\" FileWithSQLQueriesToTest.sql\n\u003c/pre\u003e\nOn Unix:\n\u003cpre\u003e\n./queryDerby.sh \"select * from LT0;select * from LT0\" FileWithSQLQueriesToTest.sql\n\u003c/pre\u003e\n\u003cp\u003eWhere the file 'FileWithSQLQueriesToTest.sql' contains:\u003c/p\u003e\n\u003cpre\u003e\nselect * from LT0;\nselect * from LT0;\n\u003c/pre\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e When creating a batch file of SQL statements, each new statement should be on it's own line and suffixed with ';'.\u003c/p\u003e\n\u003cp\u003eThis example executes the query 'select * from LT0' four times.\u003c/p\u003e\n\n\u003cp\u003eAs well as this, a 'batchprefix' SQL fragment value can be passed in using the '-batchprefix' flag. This fragment of SQL is prefixed to all SQL statements to be executed from batch files passed in when invoking 'queryDerby'. \u003cb\u003eNote:\u003c/b\u003e this \u003cb\u003eonly\u003c/b\u003e applies to the queries passed in in batch files.\u003c/p\u003e\n\n\u003cbr/\u003e\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents145\"\u003eIssuing Distributed SQL Queries\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eA GaianDB distributed query is a query against a logical table (or a \u003ca href=\"#contents341\"\u003edistributed sub-query\u003c/a\u003e) defined on multiple nodes in the network.\u003c/p\u003e\n\n\u003cp\u003eEach of the GaianDB nodes may have a different underlying data source for the logical table (e.g. an RDBMS, an excel file, etc.), however they all share the same logical table definition and so they can be queried consistently.\u003c/p\u003e\n\n\u003cp\u003eWhen the query is executed, it is 'distributed' to each GaianDB node in the network by forwarding the predicates against the queried columns. Each node then maps these locally to the underlying physical types of the data sources attached to the logical table, and performs the query.\u003c/p\u003e\n\n\u003cp\u003eFor a GaianDB node to be included in the distributed query, it's local logical table definition must have matching data types for all the columns involved in the distributed query (based on the logical table definition of the original querying node). However, there is some flexibility, as columns don't have to be present (in which case a null value will be returned) and extra columns will be ignored.\u003c/p\u003e\n\n\u003cp\u003eResults from each of these distributed queries are then union'ed together as they are fed back to the querying node in the network.\u003c/p\u003e\n\u003cbr /\u003e\n\u003cp\u003eHere is the syntax for referring to a logical table that can be used in place of any table identifier in SQL:\u003c/p\u003e\n\u003cpre\u003enew com.ibm.db2j.GaianTable('\u0026lt;Logical Table Name\u0026gt;'[, '\u0026lt;Logical Table Arguments\u0026gt;']) \u0026lt;Alias Identifier\u0026gt;\u003c/pre\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianTable('LT0') LT0\u003c/pre\u003e\n\n\u003cp\u003eOr, to query against a logical table 'ACCOUNTS', requesting \u003ca href=\"#contents234\"\u003eprovenance columns\u003c/a\u003e:\u003c/p\u003e\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianTable('ACCOUNTS', 'with_provenance') T\u003c/pre\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e The Alias Identifier should be included so that the nested query can be uniquely referenced. This is standard SQL best practice and is useful in cases where you wish to join multiple tables/queries and need to refer to each of the tables'/sub-queries' columns uniquely. For example, if two queries, aliased as Q1 \u0026 Q2 respectively, both returned the column FIRSTNAME, you could reference each queries' column uniquely by using Q1.FIRSTNAME and Q2.FIRSTNAME.\u003c/p\u003e\n\u003cp\u003eA full list of \u003ca href=\"#contents321\"\u003eLogical Table Arguments\u003c/a\u003eis described later in the document.\u003c/p\u003e\n\u003cbr /\u003e\n\n\u003cp\u003eFor convenience, GaianDB automatically maintains some system managed views to query a GaianDB logical table. For a logical table LT0, the list of all managed views is:\u003c/p\u003e\n\n\u003ctable class=\"data\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eView\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eLT0\u003c/td\u003e\n\u003ctd\u003ePropagated logical table - represents the logical table over all GaianDB nodes\u003c/td\u003e\n\u003c/tr\u003e\u003ctr\u003e\n\u003ctd\u003eLT0_0\u003c/td\u003e\n\u003ctd\u003eJust local (not propagated) - represents the logical table on the local GaianDB node only\u003c/td\u003e\n\u003c/tr\u003e\u003ctr\u003e\n\u003ctd\u003eLT0_P\u003c/td\u003e\n\u003ctd\u003ePropagated, with \u003ca href=\"#contents234\"\u003eprovenance columns\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\u003ctr\u003e\n\u003ctd\u003eLT0_X\u003c/td\u003e\n\u003ctd\u003eExplain query - see \u003ca href=\"#contents270\"\u003eExplain Queries: Getting and showing the route of a query\u003c/a\u003e for more information.\u003c/td\u003e\n\u003c/tr\u003e\u003ctr\u003e\n\u003ctd\u003eLT0_XF\u003c/td\u003e\n\u003ctd\u003eExplain query to file graph.dot - see \u003ca href=\"#contents270\"\u003eExplain Queries: Getting and showing the route of a query\u003c/a\u003e for more information.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eFor example, to retrieve all rows from logical table LT0 for data sources federated by the local GaianDB node only, use the SQL:\u003c/p\u003e\n\n\u003cpre\u003eselect * from LT0_0\u003c/pre\u003e\n  \n\u003cp\u003eNote that these views are updated automatically when a change to the GaianDB configuration for the logical table is made.\u003c/p\u003e\n\n\u003chr\u003e\u003ch3\u003e\u003ca name=\"contents341\"\u003e\u003cb\u003eDistributed Sub-queries or Pushing query processing to each node\u003c/b\u003e\u003c/a\u003e\u003c/h3\u003e\n\n\u003cp\u003eAnother, much more powerful, approach to distributed querying with GaianDB is to use distributed sub-queries. In this case, you specify a sub-query (nested query) that is 'distributed' to each GaianDB node, run locally and the results are then union'ed together as they are fed back to the original querying node in the network. The results are then queried by the querying node to get the final result set.\u003c/p\u003e\n\u003cp\u003eAs an example, the following statement defines a query to select everything from ('select * from') the results of the \ndistributed sub-query 'select * from example':\u003c/p\u003e\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select * from example') Q\u003c/pre\u003e\n\u003cp\u003eIn this case, the sub-query will be distributed to each GaianDB node in the network and will be executed \nagainst the local derby RDBMS that each GaianDB node rests on; querying a physical table named 'example', \nunder the schema 'gaiandb' of Derby database 'gaiandb' (as this is the default behaviour).\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e The 'example' table is not defined in a default GaianDB installation. If you wish to create it, \nplease refer to the \u003ca href=\"WorkedExamples.html#contents2\"\u003eWorked Examples\u003c/a\u003e.\u003c/p\u003e\n\u003cbr /\u003e\n\n\u003cp\u003eHere is the syntax for referring to a distributed sub-query that can be used in place of any table identifier in SQL:\u003c/p\u003e\n\u003cpre\u003enew com.ibm.db2j.GaianQuery('\u0026lt;Nested SQL Query\u0026gt;'[, '\u0026lt;Logical Table Arguments\u0026gt;'[, '\u0026lt;Nested Query Arguments\u0026gt;']]) \u0026lt;Alias Identifier\u0026gt;\u003c/pre\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e The Alias Identifier should be included so that the nested query can be uniquely referenced. This is standard SQL best practice and is useful in cases where you wish to join multiple tables/queries and need to refer to each of the tables'/sub-queries' columns uniquely. For example, if two queries, aliased as Q1 \u0026 Q2 respectively, both returned the column FIRSTNAME, you could reference each queries' column uniquely by using Q1.FIRSTNAME and Q2.FIRSTNAME.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e any single quotes (') appearing inside Nested SQL Queries must be escaped with another single quote ('').\u003c/p\u003e\n\u003cp\u003eA full list of \u003ca href=\"#contents321\"\u003eLogical Table Arguments and Nested Query Arguments\u003c/a\u003e is described later in the document.\u003c/p\u003e\n\u003cbr /\u003e\n\n\u003cp\u003eBy default, the nested query will be executed against the local Derby database that an GaianDB node runs on (as in the example above). \nHowever, the nested query can also target a particular \u003ca href=\"#contents342\"\u003eSOURCELIST\u003c/a\u003e; which is a way of targeting an abstracted list of \nexposed data sources individually on every node. In this case, the query is 'passed on' to each exposed data source for it to execute. \nSee the distributed query options section for more information. As an example, the following query targets a \u003ca href=\"#contents342\"\u003eSOURCELIST\u003c/a\u003e \ncalled TOYS:\u003c/p\u003e\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select * from toysales', 'with_provenance', 'SOURCELIST=TOYS') Q\u003c/pre\u003e\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e the resources referenced in this example are not setup in a default GaianDB configuration and so the example will not work\nout of the box.\u003c/p\u003e\n\n\u003cp\u003eThe nested query can also reference a logical table, as follows:\u003c/p\u003e\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select * from new com.ibm.db2j.GaianTable(''LT0'', ''maxDepth=2'') T') Q\u003c/pre\u003e\n\u003cp\u003eIn this case, the query will be distributed out from the local Derby GaianDB node to every node in the network and each of them will query the logical table 'LT0' out to a depth of 2. \u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e it would make no sense to specify a \u003ca href=\"#contents342\"\u003eSOURCELIST\u003c/a\u003e in this case as the sub-query contains a GaianDB construct (GaianTable()) which will not be meaningful to exposed data sources other than the GaianDB nodes themselves.\u003c/p\u003e\n\n\u003cbr /\u003e\n\u003cp\u003eHere are some useful tips on propagating queries using GaianQuery():\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eTo push query processing to each node, i.e. to make all nodes query their local federated data sources and return their own timestamps and provenance information, you can reference the managed view with suffix '_0'. For example: \n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select CURRENT_TIMESTAMP TS, LOCATION, MISC from LT0_0', 'with_provenance') Q\u003c/pre\u003e\n\nThis makes every node query its own local federated sources for LT0 columns LOCATION and MISC and compute its own local timestamp.\nThe provenance columns are added to the results on every node.\n\u003c/li\u003e\n\u003cbr/\u003e\n\u003cli\u003eOne way of propagating a function without needing a logical table is using a dummy system physical table.\nA dummy table tends to have a single record and is used for selecting when you're not actually interested in the data, but instead want the results of some system function in a select statement.\nThe default dummy table on Derby is 'sysibm.sysdummy1' and, as an example, it can be used to return the timestamp from each node in the network as follows:\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select current_timestamp ts from sysibm.sysdummy1', 'with_provenance') Q\u003c/pre\u003e\n\u003c/li\u003e\n\u003cbr/\u003e\n\u003cli\u003eIf a nested query contains a distributed table or query, it may only reference the provenance, explain or constant columns if these are renamed within the nested query.\nThis is because otherwise they would be seen as potential duplicates with the columns defined by the outer GaianQuery().\n\ne.g. this is invalid:\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select CURRENT_TIMESTAMP TS, GDB_NODE from LT0_P') Q\u003c/pre\u003e\n\nbut this is OK:\n\u003cpre\u003eselect * from new com.ibm.db2j.GaianQuery('select CURRENT_TIMESTAMP TS, GDB_NODE NESTED_PROVENANCE from LT0_P') Q\u003c/pre\u003e\n\u003cb\u003eNote:\u003c/b\u003e here we use the managed view 'LT0_P' which uses suffix '_P' to designate logical table 'LT0' with \u003ca href=\"#contents234\"\u003eprovenance columns\u003c/a\u003e.\n\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\u003cbr /\u003e\n\nUsing distributed sub-queries is a powerful mechanism that provides the opportunity to perform many complex operations.\nAs a final example of this, note here how it allows non-aggregate functions on partitioned data to be pushed down to all nodes in the network.\nThe GaianQuery below targets local data sources of logical table LT at each node, using LT's view having the \u0026quot;_0\u0026quot; suffix (i.e. restricted to depth 0).\nThis trick allows us to independently compare at each node the msg_received time values in LT at that node with it's own individual local system time\nand only retrieve data that was generated in the last 10 minutes.\n\u003cpre\u003eselect * from new com.ibm.db","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaiandb%2Fgaiandb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaiandb%2Fgaiandb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaiandb%2Fgaiandb/lists"}