Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Note that c.d means cargo.datasource
  • Note that if you specify a property marked do not set you will get a CargoException.

Property

Purpose

Valid Values

DataSource

Transactional DataSource

XA DataSource

c.d.jndi

The path to this datasource DataSource in JNDI

Any jndi path, like jdbc/userds

mandatory

mandatory

mandatory

c.d.driver

The implementation class

ex. my.Driver

mandatory: must implement java.sql.Driver

mandatory: must implement java.sql.Driver

mandatory: must implement javax.sql.XADataSource

c.d.properties

Properties to pass to the driver

Semi-colon delimited string

optional

optional

mandatory

c.d.url

URL for the java.sql.Driver

ex. jdbc:host:port/mydb

mandatory

mandatory

optional

c.d.type

Determines the type of the driver

Defaults to java.sql.Driver, only set if you want to use a javax.sql.XADataSource

do not set

do not set

javax.sql.XADataSource

c.d.transactionsupport

Determines transaction support type

LOCAL_TRANSACTION or XA_TRANSACTION

do not set

mandatory

unset defaults to only valid option: XA_TRANSACTION

c.d.id

Identifier used in configuration files to reference this datasourceDataSource

Must contain no path-like characters

optional

optional

optional

c.d.username

Username to connect to the database

String

optional

optional

optional

c.d.password

Password to connect to the database

String

optional

optional

optional

...

The Glassfish container has various known issues with regards to datasource DataSource support.

When you try to use Glassfish GlassFish 3.x or Glassfish GlassFish 4.x with Derby datasourcesDataSources, you might run into issues where Glassfish doesn't start, and the Glassfish logs show you messages such as the below:

...

  • ConfigurationFixtureFactory: class with method static methods showing example examples for creating various datasource various DataSource and resource types:
    • createDataSource and createAnotherDataSource: Creation of a DataSource
    • createDriverConfiguredDataSourceWithLocalTransactionSupport: Creation of a DataSource with local transaction support
    • createDriverConfiguredDataSourceWithXaTransactionSupport: Creation of a DataSource with XA transaction support
    • createXADataSourceConfiguredDataSource: Creation of an XA DataSource as DataSource
    • createConnectionPoolDataSourceAsResource: Creation of a connection pool
    • createXADataSourceAsResource: Creation of an XA DataSource as a resource
    • createMailSessionAsResource: Creation of a Mail resource
    • createDataSourceWithWindowsPath: Creation of a DataSource with a Windows path
    • createJmsQueueAsResource: Creation of a JMS resource
  • DataSourceOnStandaloneConfigurationTest: datasource  DataSource definition.
  • TransactionEmulationDataSourceOnStandaloneConfigurationTest: datasource  DataSource definition with transaction emulation.
  • XATransactionDataSourceOnStandaloneConfigurationTest: XA datasource XA DataSource definition.
  • MailResourceOnStandaloneConfigurationTest: resource Resource definition, showing for example mailsession.
  • JmsResourceOnStandaloneConfigurationTest: resource Resource definition, showing for example a JMS queue.

Users of the Maven2/Maven3 plugin can use the Maven2 Archetype showing datasource showing DataSource support. Please read: Datasource DataSource Definition Archetype.