SQLServerLaunch[{name->location,…}]
launches a database server that hosts access to the databases specified in the parameters.
Details and Options
Examples
Basic Examples
Options
"Port"
See Also
Tech Notes
Related Guides
DatabaseLink`
DatabaseLink`
SQLServerLaunch
SQLServerLaunch[{name->location,…}]
launches a database server that hosts access to the databases specified in the parameters.
Details and Options
- To use SQLServerLaunch, you first need to load DatabaseLink using Needs["DatabaseLink`"].
- The following options can be given:
-
"Address" Automatic the inet address for the server to use "Port" Automatic the port at which this server listens "SecureSockets" False whether the server should use secure sockets
Examples
open all close allBasic Examples (1)
Needs["DatabaseLink`"]s = SQLServerLaunch[{"myDb" -> FileNameJoin[{$TemporaryDirectory, "HSQLServer"}]}]Connect to the myDb database on this server:
conn = OpenSQLConnection[JDBC["HSQL(Server)", "localhost/myDb"]]Perform some operations over the connection to the local server:
SQLCreateTable[conn,
SQLTable["test"],
{
SQLColumn["A", "DataTypeName" -> "VARCHAR(128)"],
SQLColumn["B", "DataTypeName" -> "DATE"],
SQLColumn["C", "DataTypeName" -> "FLOAT"]
}
]SQLTables[conn]SQLInsert[conn, "test", {"A", "B", "C"}, {
{"left", SQLDateTime@DateList[], N@Pi}
, {"right", SQLDateTime@DateList["1 Jan 1970"], N@E}
}]SQLSelect[conn, "test"]SQLDropTable[conn, "test"];CloseSQLConnection[conn];SQLServerShutdown[s]Options (1)
"Port" (1)
Needs["DatabaseLink`"]Launch an HSQL server on a specified port:
s = SQLServerLaunch[{"myDb" -> FileNameJoin[{$TemporaryDirectory, "HSQLServer"}]}, "Port" -> 2468]Connections to this database must specify the server port:
conn = OpenSQLConnection[JDBC["HSQL(Server)", "localhost:2468/myDb"]]CloseSQLConnection[conn];SQLServerShutdown[s]