# $Id: sqltool.rc 6381 2021-11-18 21:45:56Z unsaved $ # This is a sample RC configuration file used by SqlTool, DatabaseManager, # and any other program that uses the org.hsqldb.lib.RCData class. # See the documentation for SqlTool for various ways to use this file. # This is not a Java Properties file. It uses a custom format with stanzas, # similar to .netrc files. # If you have the least concerns about security, then secure access to # your RC file. # You can run SqlTool right now by copying this file to your home directory # and running # java -jar /path/to/sqltool.jar mem # This will access the first urlid definition below in order to use a # personal Memory-Only database. # "url" values may, of course, contain JDBC connection properties, delimited # with semicolons. # As of revision 3347 of SqlFile, you can also connect to datasources defined # here from within an SqlTool session/file with the command "\j urlid". # You can use Java system property values in this file like this: ${user.home} # Windows users are advised to use forward slashes instead of back-slashes, # and to avoid paths containing spaces or other funny characters. (This # recommendation applies to any Java app, not just SqlTool). # It is a runtime error to do a urlid lookup using RCData class and to not # match any stanza (via urlid pattern) in this file. # Three features added recently. All are downward-compatible. # 1. urlid field values in this file are now comma-separated (with optional # whitespace before or after the commas) regular expressions. # 2. Each individual urlid token value (per previous bullet) is a now a regular # expression pattern that urlid lookups are compared to. N.b. patterns must # match the entire lookup string, not just match "within" it. E.g. pattern # of . would match lookup candidate "A" but not "AB". .+ will always match. # 3. Though it is still an error to define the same exact urlid value more # than once in this file, it is allowed (and useful) to have a url lookup # match more than one urlid pattern and stanza. Assignments are applied # sequentially, so you should generally add default settings with more # liberal patterns, and override settings later in the file with more # specific (or exact) patterns. # Since service discovery works great in all JREs for many years now, I # have removed all 'driver' specifications here. JRE discover will # automatically resolve the driver class based on the JDBC URL format. # Most people use default ports, so I have removed port specification from # examples except for Microsoft's Sql Server driver where you can't depend # on a default port. # In all cases, to specify a non-default port, insert colon and port number # after the hostname or ip address in the JDBC URL, like # jdbc:hsqldb:hsql://localhost:9977 or # jdbc:sqlserver://hostname.admc.com:1433;databaseName=dbname # Amazon Aurora instances are access from JDBC exactly the same as the # non-Aurora RDS counterpart. # For using any database engine other than HyperSQL, you must add the # JDBC jar file and the SqlTool jar to your CLASSPATH then run a command like: # java org.hsqldb.util.SqlTool... # I.e., the "-jar" switch doesn't support modified classpath. # (See SqlTool manual for how to do same thing using Java modules.) # To oversimplify for non-developers, the two most common methods to set # CLASSPATH for an executable tool like SqlTool are to either use the java # "-cp" switch or set environmental variable CLASSPATH. # Windows users can use graphical UI or CLI "set". Unix shell users must # "export" in addition to assigning. # # All JDBC jar files used in these examples are available from Maven # repositories. You can also get them from vendor web sites or with product # bundles (especially database distributions). # Most databases provide multiple variants. Most people will want a type 4 # driver supporting your connection mechanism (most commonly TCP/IP service, # but also database file access and others) and your client JRE version. # By convention the variants are distinguished in segments of the jar file # name before the final ".jar" . # Global default. .+ matches all lookups: urlid .+ username SA password # A personal Memory-Only (non-persistent) database. # Inherits username and password from default setting above. urlid mem url jdbc:hsqldb:mem:memdbid # A personal, local, persistent database. # Inherits username and password from default setting above. urlid personal url jdbc:hsqldb:file:${user.home}/db/personal;shutdown=true;ifexist=true transiso TRANSACTION_READ_COMMITTED # When connecting directly to a file database like this, you should # use the shutdown connection property like this to shut down the DB # properly when you exit the JVM. # This is for a hsqldb Server running with default settings on your local # computer (and for which you have not changed the password for "SA"). # Inherits username and password from default setting above. # Default port 9001 urlid localhost-sa url jdbc:hsqldb:hsql://localhost # Template for a urlid for an Oracle database. # Driver jar files from this century have format like "ojbc*.jar". # Default port 1521 urlid localhost-sa # Avoid older drivers because they have quirks. # You could use the thick driver instead of the thin, but I know of no reason # why any Java app should. #urlid cardiff2 # Can identify target database with either SID or global service name. #url jdbc:oracle:thin:@//centos.admc.com/tstsid.admc #username blaine #password asecret # Template for a TLS-encrypted HSQLDB Server. # Remember that the hostname in hsqls (and https) JDBC URLs must match the # CN of the server certificate (the port and instance alias that follows # are not part of the certificate at all). # You only need to set "truststore" if the server cert is not approved by # your system default truststore (which a commercial certificate probably # would be). # Port defaults to 554. #urlid tls #url jdbc:hsqldb:hsqls://db.admc.com:9001/lm2 #username BLAINE #password asecret #truststore ${user.home}/ca/db/db-trust.store # Template for a Postgresql database # Driver jar files are of format like "postgresql-*.jar" # Port defaults to 5432. #urlid blainedb #url jdbc:postgresql://idun.africawork.org/blainedb #username blaine #password asecret # Amazon RedShift (a fork of Postgresql) # Driver jar files are of format like "redshift-jdbc*.jar" # Port defaults to 5439. #urlid redhshift #url jdbc:redshift://clustername.hex.us-east-1.redshift.amazonaws.com/dev #username awsuser #password asecret # Template for a MySQL database. MySQL has poor JDBC support. # The latest driver jar files are of format like "mysql-jdbc*.jar", but not # long ago they were like "mysql-connector-java*.jar". # Port defaults to 3306 #urlid mysql-testdb #url jdbc:mysql://hostname/dbname #username root #password asecret # Alternatively, you can access MySQL using jdbc:mariadb URLs and driver. # Note that "databases" in SQL Server and Sybase are traditionally used for # the same purpose as "schemas" with more SQL-compliant databases. # Template for a Microsoft SQL Server database using Microsoft's Driver # Seems that some versions default to port 1433 and others to 1434. # MSDN implies instances are port-specific, so can specify port or instname. #urlid msprojsvr # Driver jar files are of format like "mssql-jdbc-*.jar". # Don't use older MS JDBC drivers (like SQL Server 2000 vintage) because they # are pitifully incompetent, handling transactions incorrectly. # I recommend that you do not use Microsoft's nonstandard format that # includes backslashes. #url jdbc:sqlserver://hostname;instanceName=instname;databaseName=dbname # with port: #url jdbc:sqlserver://hostname:1433;instanceName=instname;databaseName=dbname #username myuser #password asecret # Template for Microsoft SQL Server database using the JTDS Driver # Looks like this project is no longer maintained, so you may be better off # using the Microsoft driver above. # http://jtds.sourceforge.net Jar file has name like "jtds-1.3.1.jar". # Port defaults to 1433. # MSDN implies instances are port-specific, so can specify port or instname. #urlid nlyte #username myuser #password asecret #url jdbc:jtds:sqlserver://myhost/nlyte;instance=MSSQLSERVER # Where database is 'nlyte' and instance is 'MSSQLSERVER'. # N.b. this is diff. from MS tools and JDBC driver where (depending on which # document you read), instance or database X are specified like HOSTNAME\X. # Template for a Sybase database #urlid sybase #url jdbc:sybase:Tds:hostname:4100/dbname #username blaine #password asecret # This is for the jConnect driver (requires jconn3.jar). # Derby / Java DB. # Please see the Derby JDBC docs, because they have changed the organization # of their driver jar files in recent years. Combining that with the different # database types supported and jar file classpath chaining, and it's not # feasible to document it adequately here. # I'll just give one example using network service, which works with 10.15.2.0. # Put files derbytools*.jar, derbyclient*.jar, derbyshared*.jar into a # directory and include the path to the derbytools.jar in your classpath. # Port defaults to 1527. #url jdbc:derby://server:/databaseName #username ${user.name} #password any_noauthbydefault # If you get the right classes into classpath, local file URLs are like: #url jdbc:derby:path/to/derby/directory # You can use \= to commit, since the Derby team decided (why???) # not to implement the SQL standard statement "commit"!! # Note that SqlTool can not shut down an embedded Derby database properly, # since that requires an additional SQL connection just for that purpose. # However, I've never lost data by shutting it down improperly. # Other than not supporting this quirk of Derby, SqlTool is miles ahead of # Derby's ij. # Maria DB # With current versions, the MySQL driver does not work to access a Maria # database (though the inverse works). # Driver jar files are of format like "mariadb-java-client*.jar" # Port defaults to 3306 #urlid maria #url jdbc:mariadb://hostname/db2 #username blaine #password asecret