This topic has been updated for build 1823.
Database connection parameters, embedded HTTP server options, and OData Producer options must be configured in a configuration file. Specify this file on the command line when you start the OData Server.
The following embedded HTTP server options can be specified in the configuration file:
Option | Description |
---|---|
LogFile = path-and-filename |
Specifies the path and file name to which the embedded HTTP server logs OData Producer output. The default behavior is to disable logging. The path is relative to the location of the server executable. |
LogVerbosity = { 1 | 2 | 3 | 4 } |
Specifies the verbosity level of the logs. Higher verbosity levels log additional information and include the information provided by all lower levels. Verbosity level 1 outputs information about any unexpected errors. Verbosity level 2 outputs general information and configuration messages. Verbosity level 3 outputs detailed information about HTTP requests. Verbosity level 4 outputs debugging messages. |
Producers = comma-delimited-list-of-odata-producers |
Creates a list of custom named OData Producers. Each OData Producer can connect to its own database and has its own set of individual options that can be specified in the configuration file. Each comma-separated value in the list represents an OData Producer name. A name can be comprised of alphanumeric characters and underscores. The default behavior is to use a single default OData Producer. |
ServerPort = port-number |
Specifies the port number on which the embedded HTTP server should listen. The default setting is 80. |
ShutdownListenerPort = port-number |
Specifies the port number on which the embedded HTTP server should listen for shutdown requests. The default setting is 2449. |
SSLKeyStore = path-and-filename |
Specifies the path and file name to a Java Key Store containing an SSL certificate that the embedded HTTP server uses to encrypt traffic. SSL is enabled and unencrypted HTTP traffic is blocked when this option is specified. The path is relative to the location of the server executable. |
SSLKeyStorePassword = SSLKeyStore-password | Specifies the password that the embedded HTTP server uses to authenticate against the Java Key Store identified by the SSLKeyStore option. |
When the Embedded HTTP server Producers option is not specified, OData Producer options and connection parameter settings are applied to the default OData Producer. The [producer-name.] prefix (exemplified in the table below) is not required when using the default OData Producer.
The Producers option, allows you to specify OData Producer options and database connection parameters globally so that they apply to all OData Producers. To apply an option or connection parameter setting to an individual OData Producer, use the [producer-name.] prefix (shown in the table below), where producer-name is the name of the OData Producer that the setting applies to. Individual OData Producer options supersede any global options that may be specified.
The following OData Producer options and connection parameter settings can be specified in the configuration file:
Option | Description |
---|---|
[producer-name.]Authentication = { none | database } |
Specifies the credentials that this OData Producer uses to connect to the database. The default setting, database, indicates that each user connects with personalized credentials that are appended to the DbConnectionString option to form their own complete database connection string. These credentials are requested using Basic HTTP authentication. The none setting indicates that all users connect using the same connection string as indicated by the DbConnectionString option. |
[producer-name.]ConnectionPoolMaximum = num-max-connections |
Indicates the maximum number of simultaneous connections that this OData Producer keeps open for use in the connection pool. Fewer connections may be used by the connection pool depending on the server load. By default, the connection pool size is limited by the maximum number of simultaneous connections that are permitted by the database server. |
[producer-name.]DbConnectionString = connection-string |
Specifies the connection string used to connect to the database. The connecting string should exclude the UID and PWD parameters when the Authentication option is set to the database. |
[producer-name.]DbProduct = sqlanywhere |
Indicates the type of database server that this OData Producer connects to. |
[producer-name.]Model = path-and-filename |
Specifies the path and file name of an OData Service Definition Language (OSDL) file that contains the OData Producer service model that indicates which tables and views are exposed in the OData service (subject to user privileges). Tables and views without primary keys are not exposed. The path is relative to the location of the server executable. The default behavior is to expose all tables and views that the user has privileges to and not expose any stored procedures or functions. |
[producer-name.]ModelConnectionString = connection-string |
Specifies a connection string that this OData Producer uses to validate the OSDL file during startup. OSDL validation ensures that enlisted tables and columns exist, that key lists are used appropriately, and that the file is semantically correct. The connection string should include the UID and PWD parameters. The default behavior is to assume that the OSDL file is valid. |
[producer-name.]PageSize = num-max-entities |
Specifies the maximum number of entities to include in a retrieve entity set response before issuing a next link. The default setting is 100. |
[producer-name.]ReadOnly = { true | false }] |
Indicates whether modification requests should be ignored. The default setting is false. |
producer-name.]ServiceRoot = / path-prefix |
Specifies the root of the OData service on the OData Server. Each OData Producer must have a unique service root, and each service root must not be a sub-path of another service root. The default setting is /odata. All resources for this OData Producer are accessed using URIs of the following format: scheme:host:port/path-prefix/resource-path[query-options] For example: http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name |
The following sample illustrates how to format a configuration file:
# Embedded HTTP server options # ---------------------------- LogFile = ../../odata.log LogVerbosity = 1 ServerPort = 8000 ShutdownListenerPort = 8083 SSLKeyStore = ../../samplekeystore.jks SSLKeyStorePassword = pwd Producers = OrderEntryProducer, StaffingProducer # Shared OData Producer options # ----------------------------- Authentication = none ConnectionPoolMaximum = 10 DbProduct = sqlanywhere PageSize = 100 ReadOnly = false # OrderEntryProducer options # -------------------------- OrderEntryProducer.Model = ../../ordermodel.osdl OrderEntryProducer.ModelConnectionString = uid=dba;pwd=sql;eng=orderentry;dbf=orderentry.db OrderEntryProducer.ServiceRoot = /orders/ OrderEntryProducer.DbConnectionString = uid=dba;pwd=sql;eng=orderentry;dbf=orderentry.db # StaffingProducer options # ------------------------ StaffingProducer.Model = ../../staffingmodel.osdl StaffingProducer.ModelConnectionString = uid=dba;pwd=sql;eng=staffing;dbf=staffing.db StaffingProducer.ServiceRoot = /staffing/ StaffingProducer.DbConnectionString = uid=dba;pwd=sql;eng=staffing;dbf=staffing.db |
In this configuration, an OData Server that hosts two OData Producers is established. Some OData Producer options are shared across both OData Producers while others must be specified for each one individually.
Save the file as server.properties and then run the following command to start the OData Server with the options specified in the configuration file:
dbosrv16 server.properties |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |