Package virtuoso.jdbc4

## Class VirtuosoDataSource

- java.lang.Object
- - virtuoso.jdbc4.VirtuosoDataSource

All Implemented Interfaces:
  `java.io.Serializable`, `java.sql.Wrapper`, `javax.naming.Referenceable`, `javax.sql.CommonDataSource`, `javax.sql.DataSource`

Direct Known Subclasses:
  `VirtuosoConnectionPoolDataSource`

    public class VirtuosoDataSource
    extends java.lang.Object
    implements javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable

See Also:
  Serialized Form

### Field Summary

Fields
`protected java.lang.String` `certificate`
`protected java.lang.String` `charSet`
`protected java.lang.String` `databaseName`
`protected java.lang.String` `dataSourceName`
`protected java.lang.String` `delegate`
`protected java.lang.String` `description`
`protected int` `fbs`
`protected java.lang.String` `keystorepass`
`protected java.lang.String` `keystorepath`
`protected int` `log_enable`
`protected java.lang.String` `logFileName`
`protected int` `loginTimeout`
`protected java.io.PrintWriter` `logWriter`
`protected java.lang.String` `password`
`protected java.lang.String` `portNumber`
`protected java.lang.String` `provider`
`protected int` `pstmtpoolsize`
`protected java.lang.String` `pwdclear`
`protected int` `recvbs`
`protected boolean` `roundrobin`
`protected int` `sendbs`
`protected java.lang.String` `serverName`
`protected boolean` `ssl`
`protected java.lang.String` `truststorepass`
`protected java.lang.String` `truststorepath`
`protected boolean` `usepstmtpool`
`protected java.lang.String` `user`

### Constructor Summary

Constructors
`VirtuosoDataSource​()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `addProperties​(javax.naming.Reference ref)`
`protected java.lang.String` `create_url​()`
`protected java.lang.String` `create_url_key​(java.lang.String base_conn_url, java.util.Properties info)`
`protected java.util.Properties` `createConnProperties​()`
`java.lang.String` `getCertificate​()`
`java.lang.String` `getCharset​()`
`java.sql.Connection` `getConnection​()`
`java.sql.Connection` `getConnection​(java.lang.String username, java.lang.String password)`
`java.lang.String` `getDatabaseName​()`
`java.lang.String` `getDataSourceName​()` Get the datasource name for this instance if set.
`java.lang.String` `getDelgate​()`
`java.lang.String` `getDescription​()`
`int` `getFbs​()`
`java.lang.String` `getKeystorepass​()`
`java.lang.String` `getKeystorepath​()`
`int` `getLog_Enable​()`
`java.lang.String` `getLogFileName​()` Get the log FileName.
`int` `getLoginTimeout​()`
`java.io.PrintWriter` `getLogWriter​()`
`java.util.logging.Logger` `getParentLogger​()` Return the parent Logger of all the Loggers used by this driver.
`java.lang.String` `getPassword​()`
`int` `getPortNumber​()` Get the port number on which oplrqb is listening for requests.
`java.lang.String` `getProvider​()`
`int` `getPstmtpoolsize​()`
`java.lang.String` `getPwdClear​()`
`int` `getRecvbs​()`
`javax.naming.Reference` `getReference​()`
`boolean` `getRoundrobin​()`
`int` `getSendbs​()`
`java.lang.String` `getServerName​()`
`boolean` `getSsl​()`
`java.lang.String` `getTruststorepass​()`
`java.lang.String` `getTruststorepath​()`
`boolean` `getUsepstmtpool​()`
`java.lang.String` `getUser​()`
`boolean` `isWrapperFor​(java.lang.Class<?> iface)` Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
`void` `setCertificate​(java.lang.String value)`
`void` `setCharset​(java.lang.String name)`
`void` `setDatabaseName​(java.lang.String name)`
`void` `setDataSourceName​(java.lang.String parm)` Set the DataSource name.
`void` `setDelegate​(java.lang.String delgate)`
`void` `setDescription​(java.lang.String description)`
`void` `setFbs​(int value)`
`void` `setKeystorepass​(java.lang.String value)`
`void` `setKeystorepath​(java.lang.String value)`
`void` `setLog_Enable​(int bits)`
`void` `setLogFileName​(java.lang.String parm)` Set the log Filename.
`void` `setLoginTimeout​(int seconds)`
`void` `setLogWriter​(java.io.PrintWriter out)`
`void` `setPassword​(java.lang.String passwd)`
`void` `setPortNumber​(int parm)` Set the port number where the oplrqb is listening for requests.
`void` `setProvider​(java.lang.String value)`
`void` `setPstmtpoolsize​(int value)`
`void` `setPwdClear​(java.lang.String value)`
`void` `setRecvbs​(int value)`
`void` `setRoundrobin​(boolean value)`
`void` `setSendbs​(int value)`
`void` `setServerName​(java.lang.String serverName)`
`void` `setSsl​(boolean value)`
`void` `setTruststorepass​(java.lang.String value)`
`void` `setTruststorepath​(java.lang.String value)`
`void` `setUsepstmtpool​(boolean value)`
`void` `setUser​(java.lang.String user)`
`<T> T` `unwrap​(java.lang.Class<T> iface)` Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

### Methods inherited from interface javax.sql.CommonDataSource

`createShardingKeyBuilder`

### Methods inherited from interface javax.sql.DataSource

`createConnectionBuilder`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### logFileName

    protected java.lang.String logFileName

#### dataSourceName

    protected java.lang.String dataSourceName

#### description

    protected java.lang.String description

#### serverName

    protected java.lang.String serverName

#### portNumber

    protected java.lang.String portNumber

#### databaseName

    protected java.lang.String databaseName

#### user

    protected java.lang.String user

#### password

    protected java.lang.String password

#### delegate

    protected java.lang.String delegate

#### charSet

    protected java.lang.String charSet

#### loginTimeout

    protected int loginTimeout

#### pwdclear

    protected java.lang.String pwdclear

#### log_enable

    protected int log_enable

#### certificate

    protected java.lang.String certificate

#### keystorepass

    protected java.lang.String keystorepass

#### keystorepath

    protected java.lang.String keystorepath

#### provider

    protected java.lang.String provider

#### truststorepass

    protected java.lang.String truststorepass

#### truststorepath

    protected java.lang.String truststorepath

#### ssl

    protected boolean ssl

#### fbs

    protected int fbs

#### sendbs

    protected int sendbs

#### recvbs

    protected int recvbs

#### roundrobin

    protected boolean roundrobin

#### usepstmtpool

    protected boolean usepstmtpool

#### pstmtpoolsize

    protected int pstmtpoolsize

#### logWriter

    protected transient java.io.PrintWriter logWriter

### Constructor Detail

#### VirtuosoDataSource

    public VirtuosoDataSource​()

### Method Detail

#### addProperties

    protected void addProperties​(javax.naming.Reference ref)

#### getReference

    public javax.naming.Reference getReference​()
                                        throws javax.naming.NamingException

Specified by:
  `getReference` in interface `javax.naming.Referenceable`
Throws:
  `javax.naming.NamingException`

#### createConnProperties

    protected java.util.Properties createConnProperties​()

#### create_url_key

    protected java.lang.String create_url_key​(java.lang.String base_conn_url,
                                              java.util.Properties info)

#### create_url

    protected java.lang.String create_url​()

#### getConnection

    public java.sql.Connection getConnection​()
                                      throws java.sql.SQLException

Specified by:
  `getConnection` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### getConnection

    public java.sql.Connection getConnection​(java.lang.String username,
                                             java.lang.String password)
                                      throws java.sql.SQLException

Specified by:
  `getConnection` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### getLogWriter

    public java.io.PrintWriter getLogWriter​()
                                     throws java.sql.SQLException

Specified by:
  `getLogWriter` in interface `javax.sql.CommonDataSource`
Specified by:
  `getLogWriter` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### setLogWriter

    public void setLogWriter​(java.io.PrintWriter out)
                      throws java.sql.SQLException

Specified by:
  `setLogWriter` in interface `javax.sql.CommonDataSource`
Specified by:
  `setLogWriter` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### setLoginTimeout

    public void setLoginTimeout​(int seconds)
                         throws java.sql.SQLException

Specified by:
  `setLoginTimeout` in interface `javax.sql.CommonDataSource`
Specified by:
  `setLoginTimeout` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### getLoginTimeout

    public int getLoginTimeout​()
                        throws java.sql.SQLException

Specified by:
  `getLoginTimeout` in interface `javax.sql.CommonDataSource`
Specified by:
  `getLoginTimeout` in interface `javax.sql.DataSource`
Throws:
  `java.sql.SQLException`

#### getLogFileName

    public java.lang.String getLogFileName​()

Get the log FileName. The default value is null

Returns:
  log Filename

#### setLogFileName

    public void setLogFileName​(java.lang.String parm)

Set the log Filename. The default value is null

Parameters:
  `parm` - Filename to be set

#### getDataSourceName

    public java.lang.String getDataSourceName​()

Get the datasource name for this instance if set. The default value is "VirtuosoDataSourceName"

Returns:
  DataSource name

#### setDataSourceName

    public void setDataSourceName​(java.lang.String parm)

Set the DataSource name. The default value is "VirtuosoDataSourceName"

Parameters:
  `parm` - DataSource name to be set

#### setDescription

    public void setDescription​(java.lang.String description)

#### getDescription

    public java.lang.String getDescription​()

#### setServerName

    public void setServerName​(java.lang.String serverName)

#### getServerName

    public java.lang.String getServerName​()

#### getPortNumber

    public int getPortNumber​()

Get the port number on which oplrqb is listening for requests. The default value is 1111

Returns:
  port number

#### setPortNumber

    public void setPortNumber​(int parm)

Set the port number where the oplrqb is listening for requests. The default value is 1111 . Will be overwritten with value from URL, if URL is set.

Parameters:
  `parm` - port number on which oplrqb is listening

#### setUser

    public void setUser​(java.lang.String user)

#### getUser

    public java.lang.String getUser​()

#### setPassword

    public void setPassword​(java.lang.String passwd)

#### getPassword

    public java.lang.String getPassword​()

#### setDelegate

    public void setDelegate​(java.lang.String delgate)

#### getDelgate

    public java.lang.String getDelgate​()

#### setDatabaseName

    public void setDatabaseName​(java.lang.String name)

#### getDatabaseName

    public java.lang.String getDatabaseName​()

#### setCharset

    public void setCharset​(java.lang.String name)

#### getCharset

    public java.lang.String getCharset​()

#### setPwdClear

    public void setPwdClear​(java.lang.String value)

#### getPwdClear

    public java.lang.String getPwdClear​()

#### setLog_Enable

    public void setLog_Enable​(int bits)

#### getLog_Enable

    public int getLog_Enable​()

#### setCertificate

    public void setCertificate​(java.lang.String value)

#### getCertificate

    public java.lang.String getCertificate​()

#### setKeystorepass

    public void setKeystorepass​(java.lang.String value)

#### getKeystorepass

    public java.lang.String getKeystorepass​()

#### setKeystorepath

    public void setKeystorepath​(java.lang.String value)

#### getKeystorepath

    public java.lang.String getKeystorepath​()

#### setProvider

    public void setProvider​(java.lang.String value)

#### getProvider

    public java.lang.String getProvider​()

#### setTruststorepass

    public void setTruststorepass​(java.lang.String value)

#### getTruststorepass

    public java.lang.String getTruststorepass​()

#### setTruststorepath

    public void setTruststorepath​(java.lang.String value)

#### getTruststorepath

    public java.lang.String getTruststorepath​()

#### setSsl

    public void setSsl​(boolean value)

#### getSsl

    public boolean getSsl​()

#### setFbs

    public void setFbs​(int value)

#### getFbs

    public int getFbs​()

#### setSendbs

    public void setSendbs​(int value)

#### getSendbs

    public int getSendbs​()

#### setRecvbs

    public void setRecvbs​(int value)

#### getRecvbs

    public int getRecvbs​()

#### setRoundrobin

    public void setRoundrobin​(boolean value)

#### getRoundrobin

    public boolean getRoundrobin​()

#### setUsepstmtpool

    public void setUsepstmtpool​(boolean value)

#### getUsepstmtpool

    public boolean getUsepstmtpool​()

#### setPstmtpoolsize

    public void setPstmtpoolsize​(int value)

#### getPstmtpoolsize

    public int getPstmtpoolsize​()

#### unwrap

    public <T> T unwrap​(java.lang.Class<T> iface)
                 throws java.sql.SQLException

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling `unwrap` recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an `SQLException` is thrown.

Specified by:
  `unwrap` in interface `java.sql.Wrapper`
Parameters:
  `iface` - A Class defining an interface that the result must implement.
Returns:
  an object that implements the interface. May be a proxy for the actual implementing object.
Throws:
  `java.sql.SQLException` - If no object found that implements the interface
Since:
  1.6

#### isWrapperFor

    public boolean isWrapperFor​(java.lang.Class<?> iface)
                         throws java.sql.SQLException

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling `isWrapperFor` on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to `unwrap` so that callers can use this method to avoid expensive `unwrap` calls that may fail. If this method returns true then calling `unwrap` with the same argument should succeed.

Specified by:
  `isWrapperFor` in interface `java.sql.Wrapper`
Parameters:
  `iface` - a Class defining an interface.
Returns:
  true if this implements the interface or directly or indirectly wraps an object that does.
Throws:
  `java.sql.SQLException` - if an error occurs while determining whether this is a wrapper for an object with the given interface.
Since:
  1.6

#### getParentLogger

    public java.util.logging.Logger getParentLogger​()
                                             throws java.sql.SQLFeatureNotSupportedException

Return the parent Logger of all the Loggers used by this driver. This should be the Logger farthest from the root Logger that is still an ancestor of all of the Loggers used by this driver. Configuring this Logger will affect all of the log messages generated by the driver. In the worst case, this may be the root Logger.

Specified by:
  `getParentLogger` in interface `javax.sql.CommonDataSource`
Returns:
  the parent Logger for this driver
Throws:
  `java.sql.SQLFeatureNotSupportedException` - if the driver does not use `java.util.logging`.
Since:
  1.7