Bookmark and Share Share

<datasource>

Optional element to declare the connection information to a database. Connection configuration can be specified as a JDBC connection or using JNDI. This connection information is used to execute SQL commands.

You can declare any number of named datasources in a mashup script. You can also use a single, unnamed datasource that is considered the default. EMML statements that execute SQL commands and do not have a datasource name use the default datasource.

Datasource names must be unique within a given EMML Engine.

See also Declaring Data Sources for more information and examples.

Can Contain Empty
Allowed In mashup, else, elseif, for, foreach, if, macro, operation, sequence, while

Attributes

Name Required Description
name  

Optional name for this datasource. If omitted, this becomes the default datasource for SQL commands that do not define a datasource.

url  

The URL for a JDBC connection to this datasource in the form jdbc:name:protocol://host:port. If omitted, you must specify connection information for this datasource in the jndiname attribute.

driverClassName  

The class name of the driver for a JDBC connection to this datasource. This is only relevant if url is specified. If omitted, this defaults to the HSQLDB JDBC driver class.

username  

The user name for the JDBC connection to this datasource. This is required for JDBC connections (in url), but is not relevant for JNDI connections.

password  

The password to log into this datasource with. This is required, but can be empty, for JDBC connections (in url). It is not relevant for JNDI connections.

jndiname  

The JDNI name for this datasource, in the form java:/comp/env/jdbc/jndi-name. If omitted, you must specify JDBC connection information in the url and related attributes.