SQLServerLaunch[{name->location,…}]
launches a database server that hosts access to the databases specified in the parameters.
更多信息和选项
范例
基本范例
Options
"Port"
参见
技术笔记
相关指南
DatabaseLink`
DatabaseLink`
SQLServerLaunch
SQLServerLaunch[{name->location,…}]
launches a database server that hosts access to the databases specified in the parameters.
更多信息和选项
- 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
范例
打开所有单元 关闭所有单元基本范例 (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]