Difference between revisions of "Database/Drivers/MySQL Native/Connector/C-OOo-Connect-URL"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(35 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
'''All: please comment!'''
 
'''All: please comment!'''
  
This suggestion is based on the MySQL Connector/J documentation and [http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html the MySQL C-API documentation].  
+
This suggestion is based on the MySQL Connector/J documentation and [http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html the MySQL C-API documentation] as well as the [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/XDriver.html#connect XDriver::connect] and related documentation.  
  
=== Basic syntax ===
+
=== Connection URL ===
  
<code>sdbc:mysqlc:://[host[:port]]/database[?propertyName1]=[propertyValue1][&propertyName2]=[propertyValue2]...</code>
+
'''<code>sdbc:mysql:mysqlc:[host[:port]]/database'''
  
The value of host may be either a hostname or an IP address. If host is NULL or the string "localhost", a connection to the local host is assumed. For Windows, the client connects using a shared-memory connection, if the server has shared-memory connections enabled. Otherwise, TCP/IP is used. For Unix, the client connects using a Unix socket file. For local connections, you can also influence the type of connection to use with the MYSQL_OPT_PROTOCOL or MYSQL_OPT_NAMED_PIPE options to mysql_options(). The type of connection must be supported by the server. For a host value of "." on Windows, the client connects using a named pipe, if the server has named-pipe connections enabled. If named-pipe connections are not enabled, an error occurs.
+
The value of host may be either a hostname or an IP address. If host is NULL or the string "localhost", a connection to the local host is assumed. For Windows, the client connects using a shared-memory connection, if the server has shared-memory connections enabled. Otherwise, TCP/IP is used. For Unix, the client connects using a Unix socket file.  
 +
 
 +
For local connections, you can also influence the type of connection to use with the MYSQL_OPT_PROTOCOL or MYSQL_OPT_NAMED_PIPE options to mysql_options(). The type of connection must be supported by the server. For a host value of "." on Windows, the client connects using a named pipe, if the server has named-pipe connections enabled. If named-pipe connections are not enabled, an error occurs.
  
 
If the hostname is not specified, it defaults to 127.0.0.1
 
If the hostname is not specified, it defaults to 127.0.0.1
Line 17: Line 19:
 
If the database is not specified, the connection will be made with no default database.
 
If the database is not specified, the connection will be made with no default database.
  
=== Connection/Authentification ===
+
=== Connection Properties ===
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 26: Line 28:
 
! Supported in GUI
 
! Supported in GUI
 
|-
 
|-
| user
+
| string '''User'''
 
| The user to connect as
 
| The user to connect as
 
|
 
|
| >= 2.4
+
| '''>= 2.4'''
 
|-
 
|-
| password
+
| string '''Password'''
 
| The password to use when connecting
 
| The password to use when connecting
 
|
 
|
| >= 2.4
+
| '''>= 2.4'''
 
|-
 
|-
| socket
+
| string '''Socket'''
 
| The UNIX domain socket or Windows named pipe to use when connecting
 
| The UNIX domain socket or Windows named pipe to use when connecting
 
| If socket is not empty, the string specifies the socket or named pipe that should be used. Note that the host parameter determines the type of the connection.
 
| If socket is not empty, the string specifies the socket or named pipe that should be used. Note that the host parameter determines the type of the connection.
| >= 3.0
+
| '''>= 3.0'''
 
|-
 
|-
| connectionTimeout
+
| long Charset
|
+
|
+
|-
+
| character_set
+
 
| The name of the character set to use as the default character set.
 
| The name of the character set to use as the default character set.
|
+
| See also [http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html mysql_options()]
|
+
| >= 3.1
 
|-
 
|-
| debug
+
| boolean Compression
 +
| Use compression protocol
 +
| See also [http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html CLIENT_COMPRESS]
 +
| >= 3.1
 +
|-
 +
| long ConnectionTimeout
 
|
 
|
| Turn on debug output
+
| See also [http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html mysql_options()]
|
+
| >= 3.1
| (development build only?)
+
|-
 +
| string Debug
 +
| For developers: URL with debug parameters
 +
| Turn on debug output - TBD
 +
| >= 3.1
 
|}
 
|}
  
=== Supported through the GUI ===
+
=== Support through the GUI ===
 +
 
 +
''The OO.org GUI has been frozen for the 3.0 Release. No changes are possible.''
 +
 
 +
The type column shows the meta type and the minimum input length that should be accepted by the GUI. The GUI may use broader input fields to beautify the layout.
 +
 
 +
 
 +
 
 +
 
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Input field
 +
! OOo version
 +
! Property or URL
 +
! Meta Type
 +
! Constraints / Checks
 +
! Comment
 +
|-
 +
| '''User'''
 +
| '''>= 2.4'''
 +
| Property
 +
| alphanumeric, >= 16 characters
 +
| none
 +
| GUI may use a broader input field.
 +
|-
 +
| '''Password'''
 +
| '''>= 2.4'''
 +
| Property
 +
| alphanumeric, >= 32 characters
 +
| none
 +
| GUI may use a broader input field.
 +
|-
 +
| '''Database'''
 +
| '''>= 2.4'''
 +
| URL
 +
| alphanumeric, >= 32 characters
 +
|
 +
| GUI may use a broader input field.
 +
|-
 +
| '''Host'''
 +
| '''>= 2.4'''
 +
| URL
 +
| alphanumeric, >= 32 characters
 +
|
 +
| GUI may use a broader input field.
 +
|-
 +
| '''Port'''
 +
| '''>= 2.4'''
 +
| URL
 +
| numeric, 5 numbers
 +
| The user can either specify a port or a socket. Input at Port disables Socket input field.
 +
| GUI may use a broader input field.
 +
|-
 +
| '''Socket'''
 +
| '''>= 3.0'''
 +
| Property
 +
| alphanumeric, >= 32 characters
 +
| The user can either specify a port or a socket. Input at Socket disables Port input field.
 +
| GUI may use a broader input field.
 +
|-
 +
| Charset
 +
| >= 3.1
 +
| Property
 +
| TBD
 +
| TBD
 +
| TBD
 +
|-
 +
| Compression
 +
| >= 3.1
 +
| Property
 +
| TBD
 +
| TBD
 +
| TBD
 +
|-
 +
| ConnectionTimeout
 +
| >= 3.1
 +
| Property
 +
| numeric, 4 numbers
 +
| none
 +
| GUI may use a broader input field.
 +
|-
 +
| Debug
 +
| >= 3.1
 +
| Property
 +
| alphanumeric, >= 64 characters
 +
| TDB - discuss if this should be only available with debug builds
 +
| GUI may use a broader input field.
 +
|}
 +
[[Category:MySQL]]

Latest revision as of 21:40, 15 December 2009

MySQL Connector/OpenOffice.org Connection URL

All: please comment!

This suggestion is based on the MySQL Connector/J documentation and the MySQL C-API documentation as well as the XDriver::connect and related documentation.

Connection URL

sdbc:mysql:mysqlc:[host[:port]]/database

The value of host may be either a hostname or an IP address. If host is NULL or the string "localhost", a connection to the local host is assumed. For Windows, the client connects using a shared-memory connection, if the server has shared-memory connections enabled. Otherwise, TCP/IP is used. For Unix, the client connects using a Unix socket file.

For local connections, you can also influence the type of connection to use with the MYSQL_OPT_PROTOCOL or MYSQL_OPT_NAMED_PIPE options to mysql_options(). The type of connection must be supported by the server. For a host value of "." on Windows, the client connects using a named pipe, if the server has named-pipe connections enabled. If named-pipe connections are not enabled, an error occurs.

If the hostname is not specified, it defaults to 127.0.0.1

If the port is not specified, it defaults to 3306, the default port number for MySQL Servers

If the database is not specified, the connection will be made with no default database.

Connection Properties

Property Name Definition Comments Supported in GUI
string User The user to connect as >= 2.4
string Password The password to use when connecting >= 2.4
string Socket The UNIX domain socket or Windows named pipe to use when connecting If socket is not empty, the string specifies the socket or named pipe that should be used. Note that the host parameter determines the type of the connection. >= 3.0
long Charset The name of the character set to use as the default character set. See also mysql_options() >= 3.1
boolean Compression Use compression protocol See also CLIENT_COMPRESS >= 3.1
long ConnectionTimeout See also mysql_options() >= 3.1
string Debug For developers: URL with debug parameters Turn on debug output - TBD >= 3.1

Support through the GUI

The OO.org GUI has been frozen for the 3.0 Release. No changes are possible.

The type column shows the meta type and the minimum input length that should be accepted by the GUI. The GUI may use broader input fields to beautify the layout.



Input field OOo version Property or URL Meta Type Constraints / Checks Comment
User >= 2.4 Property alphanumeric, >= 16 characters none GUI may use a broader input field.
Password >= 2.4 Property alphanumeric, >= 32 characters none GUI may use a broader input field.
Database >= 2.4 URL alphanumeric, >= 32 characters GUI may use a broader input field.
Host >= 2.4 URL alphanumeric, >= 32 characters GUI may use a broader input field.
Port >= 2.4 URL numeric, 5 numbers The user can either specify a port or a socket. Input at Port disables Socket input field. GUI may use a broader input field.
Socket >= 3.0 Property alphanumeric, >= 32 characters The user can either specify a port or a socket. Input at Socket disables Port input field. GUI may use a broader input field.
Charset >= 3.1 Property TBD TBD TBD
Compression >= 3.1 Property TBD TBD TBD
ConnectionTimeout >= 3.1 Property numeric, 4 numbers none GUI may use a broader input field.
Debug >= 3.1 Property alphanumeric, >= 64 characters TDB - discuss if this should be only available with debug builds GUI may use a broader input field.
Personal tools