New Connection (gb.db2)
Creates a new connection object.
-
DatabaseURL : An optional URL that specifies the connection arguments.
The format of the DatabaseURL argument is:
<TYPE>://[<USER>[:<PASSWORD>]@]<HOST>[:<PORT>]/<NAME>
where the <USER>
and <PORT>
parts are optional. If this parameter is given and valid, the connection properties are filled with the information.
自从 3.18
The password can now be specified in the URL.
Examples
' Create a MySQL connection
$hConn = New Connection("mysql://root@localhost:3306/testdb")
' Don't forget to set $hConn.Password if need be
' Create a SQLite3 connection, use $HOME/db.sqlite as database
$hConn = New Connection("sqlite3://" & User.Home &/ "db.sqlite")