org.sqlite

## クラス SQLiteDataSource

- java.lang.Object
- - org.sqlite.SQLiteDataSource

すべての実装されたインタフェース:
  Wrapper, CommonDataSource, DataSource

直系の既知のサブクラス:
  SQLiteConnectionPoolDataSource

    public class SQLiteDataSource
    extends Object
    implements DataSource

Provides `DataSource` API for configuring SQLite database connection

作成者:
  leo

### コンストラクタの概要

コンストラクタ
コンストラクタと説明
`SQLiteDataSource()` Default constructor.
`SQLiteDataSource(SQLiteConfig config)` Creates a data source based on the provided configuration.

### メソッドの概要

メソッド
`SQLiteConfig` `getConfig()`
`Connection` `getConnection()`
`Connection` `getConnection(String username, String password)`
`String` `getDatabaseName()`
`int` `getLoginTimeout()`
`PrintWriter` `getLogWriter()`
`Logger` `getParentLogger()`
`String` `getUrl()`
`boolean` `isWrapperFor(Class<?> iface)` Determines if this object wraps a given class.
`void` `setCacheSize(int numberOfPages)` Sets the suggested maximum number of database disk pages that SQLite will hold in memory at once per open database file.
`void` `setCaseSensitiveLike(boolean enable)` Enables or disables case sensitivity for the built-in LIKE operator.
`void` `setConfig(SQLiteConfig config)` Sets a data source's configuration.
`void` `setCouncChanges(boolean enable)` Enables or disables the count-changes flag.
`void` `setDatabaseName(String databaseName)` Sets the database name.
`void` `setDefaultCacheSize(int numberOfPages)` Sets the default maximum number of database disk pages that SQLite will hold in memory at once per open database file.
`void` `setEncoding(String encoding)` Sets the text encoding used by the main database.
`void` `setEnforceForeinKeys(boolean enforce)` Enables or disables the enforcement of foreign key constraints.
`void` `setFullColumnNames(boolean enable)` Enables or disables the full_column_names flag.
`void` `setFullSync(boolean enable)` Enables or disables the fullfsync flag.
`void` `setIncrementalVacuum(int numberOfPagesToBeRemoved)` Set the incremental_vacuum value that causes up to N pages to be removed from the http://www.sqlite.org/fileformat2.html#freelist.
`void` `setJournalMode(String mode)` Sets the journal mode for databases associated with the current database connection.
`void` `setJournalSizeLimit(int limit)` Sets the limit of the size of rollback-journal and WAL files left in the file-system after transactions or checkpoints.
`void` `setLegacyFileFormat(boolean use)` Set the value of the legacy_file_format flag.
`void` `setLoadExtension(boolean enable)` Enables or disables extension loading.
`void` `setLockingMode(String mode)` Sets the database connection locking-mode.
`void` `setLoginTimeout(int seconds)`
`void` `setLogWriter(PrintWriter out)`
`void` `setMaxPageCount(int numPages)` Set the maximum number of pages in the database file.
`void` `setPageSize(int numBytes)` Set the page size of the database.
`void` `setReadOnly(boolean readOnly)` Sets the database to be opened in read-only mode
`void` `setReadUncommited(boolean useReadUncommitedIsolationMode)` Set READ UNCOMMITTED isolation
`void` `setRecursiveTriggers(boolean enable)` Enables or disables the recursive trigger capability.
`void` `setReverseUnorderedSelects(boolean enable)` Enables or disables the reverse_unordered_selects flag.
`void` `setSharedCache(boolean enable)` Enables or disables the sharing of the database cache and schema data structures between connections to the same database.
`void` `setShortColumnNames(boolean enable)` Enables or disables the short_column_names flag.
`void` `setSynchronous(String mode)` Sets the setting of the "synchronous" flag.
`void` `setTempStore(String storeType)` Set the temp_store type which is used to determine where temporary tables and indices are stored.
`void` `setTempStoreDirectory(String directoryName)` Set the value of the sqlite3_temp_directory global variable, which many operating-system interface backends use to determine where to store temporary tables and indices.
`void` `setTransactionMode(String transactionMode)` Sets the mode that will be used to start transactions for this database.
`void` `setUrl(String url)` Sets the location of the database file.
`void` `setUserVersion(int version)` Sets the value of the user-version.
`<T> T` `unwrap(Class<T> iface)` Casts this object to the given class.

### クラスから継承されたメソッド java.lang.Object

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

### コンストラクタの詳細

#### SQLiteDataSource

    public SQLiteDataSource()

Default constructor.

#### SQLiteDataSource

    public SQLiteDataSource(SQLiteConfig config)

Creates a data source based on the provided configuration.

パラメータ:
  `config` - The configuration for the data source.

### メソッドの詳細

#### setConfig

    public void setConfig(SQLiteConfig config)

Sets a data source's configuration.

パラメータ:
  `config` - The configuration.

#### getConfig

    public SQLiteConfig getConfig()

戻り値:
  The configuration for the data source.

#### setUrl

    public void setUrl(String url)

Sets the location of the database file.

パラメータ:
  `url` - The location of the database file.

#### getUrl

    public String getUrl()

戻り値:
  The location of the database file.

#### setDatabaseName

    public void setDatabaseName(String databaseName)

Sets the database name.

パラメータ:
  `databaseName` - The name of the database

#### getDatabaseName

    public String getDatabaseName()

戻り値:
  The name of the database if one was set.
関連項目:
  `setDatabaseName(String)`

#### setSharedCache

    public void setSharedCache(boolean enable)

Enables or disables the sharing of the database cache and schema data structures between connections to the same database.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/c3ref/enable_shared_cache.html

#### setLoadExtension

    public void setLoadExtension(boolean enable)

Enables or disables extension loading.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/c3ref/load_extension.html

#### setReadOnly

    public void setReadOnly(boolean readOnly)

Sets the database to be opened in read-only mode

パラメータ:
  `readOnly` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/c3ref/c_open_autoproxy.html

#### setCacheSize

    public void setCacheSize(int numberOfPages)

Sets the suggested maximum number of database disk pages that SQLite will hold in memory at once per open database file.

パラメータ:
  `numberOfPages` - The number of database disk pages.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_cache_size

#### setCaseSensitiveLike

    public void setCaseSensitiveLike(boolean enable)

Enables or disables case sensitivity for the built-in LIKE operator.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/compile.html#case_sensitive_like

#### setCouncChanges

    public void setCouncChanges(boolean enable)

Enables or disables the count-changes flag. When enabled INSERT, UPDATE and DELETE statements return the number of rows they modified.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_count_changes

#### setDefaultCacheSize

    public void setDefaultCacheSize(int numberOfPages)

Sets the default maximum number of database disk pages that SQLite will hold in memory at once per open database file.

パラメータ:
  `numberOfPages` - The default suggested cache size.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_cache_size

#### setEncoding

    public void setEncoding(String encoding)

Sets the text encoding used by the main database.

パラメータ:
  `encoding` - One of "UTF-8", "UTF-16le" (little-endian UTF-16) or "UTF-16be" (big-endian UTF-16).
関連項目:
  http://www.sqlite.org/pragma.html#pragma_encoding

#### setEnforceForeinKeys

    public void setEnforceForeinKeys(boolean enforce)

Enables or disables the enforcement of foreign key constraints.

パラメータ:
  `enforce` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_foreign_keys

#### setFullColumnNames

    public void setFullColumnNames(boolean enable)

Enables or disables the full_column_names flag. This flag together with the short_column_names flag determine the way SQLite assigns names to result columns of SELECT statements.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_full_column_names

#### setFullSync

    public void setFullSync(boolean enable)

Enables or disables the fullfsync flag. This flag determines whether or not the F_FULLFSYNC syncing method is used on systems that support it.

パラメータ:
  `enable` - True to enable; false to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_fullfsync

#### setIncrementalVacuum

    public void setIncrementalVacuum(int numberOfPagesToBeRemoved)

Set the incremental_vacuum value that causes up to N pages to be removed from the http://www.sqlite.org/fileformat2.html#freelist.

パラメータ:
  `numberOfPagesToBeRemoved` -
関連項目:
  http://www.sqlite.org/pragma.html#pragma_incremental_vacuum

#### setJournalMode

    public void setJournalMode(String mode)

Sets the journal mode for databases associated with the current database connection.

パラメータ:
  `mode` - One of DELETE, TRUNCATE, PERSIST, MEMORY, WAL or OFF.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_journal_mode

#### setJournalSizeLimit

    public void setJournalSizeLimit(int limit)

Sets the limit of the size of rollback-journal and WAL files left in the file-system after transactions or checkpoints.

パラメータ:
  `limit` - The default journal size limit is -1 (no limit).
関連項目:
  http://www.sqlite.org/pragma.html#pragma_journal_size_limit

#### setLegacyFileFormat

    public void setLegacyFileFormat(boolean use)

Set the value of the legacy_file_format flag. When this flag is on, new databases are created in a file format that is readable and writable by all versions of SQLite going back to 3.0.0. When the flag is off, new databases are created using the latest file format which might not be readable or writable by versions of SQLite prior to 3.3.0.

パラメータ:
  `use` - True to turn on; false to turn off.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_legacy_file_format

#### setLockingMode

    public void setLockingMode(String mode)

Sets the database connection locking-mode.

パラメータ:
  `mode` - Either NORMAL or EXCLUSIVE.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_locking_mode

#### setPageSize

    public void setPageSize(int numBytes)

Set the page size of the database.

パラメータ:
  `numBytes` - The page size must be a power of two between 512 and 65536 inclusive.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_page_size

#### setMaxPageCount

    public void setMaxPageCount(int numPages)

Set the maximum number of pages in the database file.

パラメータ:
  `numPages` - The maximum page count cannot be reduced below the current database size.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_max_page_count

#### setReadUncommited

    public void setReadUncommited(boolean useReadUncommitedIsolationMode)

Set READ UNCOMMITTED isolation

パラメータ:
  `useReadUncommitedIsolationMode` - True to turn on; false to turn off.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_read_uncommitted

#### setRecursiveTriggers

    public void setRecursiveTriggers(boolean enable)

Enables or disables the recursive trigger capability. Changing the recursive_triggers setting affects the execution of all statements prepared using the database connection, including those prepared before the setting was changed.

パラメータ:
  `enable` - True to enable; fase to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_recursive_triggers

#### setReverseUnorderedSelects

    public void setReverseUnorderedSelects(boolean enable)

Enables or disables the reverse_unordered_selects flag. When enabled it causes SELECT statements without an ORDER BY clause to emit their results in the reverse order of what they normally would.

パラメータ:
  `enable` - True to enable; fase to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_reverse_unordered_selects

#### setShortColumnNames

    public void setShortColumnNames(boolean enable)

Enables or disables the short_column_names flag. This flag affects the way SQLite names columns of data returned by SELECT statements.

パラメータ:
  `enable` - True to enable; fase to disable.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_short_column_names, http://www.sqlite.org/pragma.html#pragma_fullfsync

#### setSynchronous

    public void setSynchronous(String mode)

Sets the setting of the "synchronous" flag.

パラメータ:
  `mode` - One of OFF, NORMAL or FULL;
関連項目:
  http://www.sqlite.org/pragma.html#pragma_synchronous

#### setTempStore

    public void setTempStore(String storeType)

Set the temp_store type which is used to determine where temporary tables and indices are stored.

パラメータ:
  `storeType` - One of "DEFAULT", "FILE", "MEMORY"
関連項目:
  http://www.sqlite.org/pragma.html#pragma_temp_store

#### setTempStoreDirectory

    public void setTempStoreDirectory(String directoryName)

Set the value of the sqlite3_temp_directory global variable, which many operating-system interface backends use to determine where to store temporary tables and indices.

パラメータ:
  `directoryName` - The temporary directory name.
関連項目:
  http://www.sqlite.org/pragma.html#pragma_temp_store_directory

#### setTransactionMode

    public void setTransactionMode(String transactionMode)

Sets the mode that will be used to start transactions for this database.

パラメータ:
  `transactionMode` - One of DEFFERED, IMMEDIATE or EXCLUSIVE.
関連項目:
  http://www.sqlite.org/lang_transaction.html

#### setUserVersion

    public void setUserVersion(int version)

Sets the value of the user-version. It is a big-endian 32-bit signed integer stored in the database header at offset 60.

パラメータ:
  `version` -
関連項目:
  http://www.sqlite.org/pragma.html#pragma_schema_version

#### getConnection

    public Connection getConnection()
                             throws SQLException

定義:
  `getConnection` インタフェース内 `DataSource`
例外:
  `SQLException`
関連項目:
  `DataSource.getConnection()`

#### getConnection

    public Connection getConnection(String username,
                           String password)
                             throws SQLException

定義:
  `getConnection` インタフェース内 `DataSource`
例外:
  `SQLException`
関連項目:
  `DataSource.getConnection(java.lang.String, java.lang.String)`

#### getLogWriter

    public PrintWriter getLogWriter()
                             throws SQLException

定義:
  `getLogWriter` インタフェース内 `CommonDataSource`
例外:
  `SQLException`
関連項目:
  `CommonDataSource.getLogWriter()`

#### getLoginTimeout

    public int getLoginTimeout()
                        throws SQLException

定義:
  `getLoginTimeout` インタフェース内 `CommonDataSource`
例外:
  `SQLException`
関連項目:
  `CommonDataSource.getLoginTimeout()`

#### getParentLogger

    public Logger getParentLogger()
                           throws SQLFeatureNotSupportedException

定義:
  `getParentLogger` インタフェース内 `CommonDataSource`
例外:
  `SQLFeatureNotSupportedException`

#### setLogWriter

    public void setLogWriter(PrintWriter out)
                      throws SQLException

定義:
  `setLogWriter` インタフェース内 `CommonDataSource`
例外:
  `SQLException`
関連項目:
  `CommonDataSource.setLogWriter(java.io.PrintWriter)`

#### setLoginTimeout

    public void setLoginTimeout(int seconds)
                         throws SQLException

定義:
  `setLoginTimeout` インタフェース内 `CommonDataSource`
例外:
  `SQLException`
関連項目:
  `CommonDataSource.setLoginTimeout(int)`

#### isWrapperFor

    public boolean isWrapperFor(Class<?> iface)
                         throws SQLException

Determines if this object wraps a given class.

定義:
  `isWrapperFor` インタフェース内 `Wrapper`
パラメータ:
  `iface` - The class to check.
戻り値:
  True if it is an instance of the current class; false otherwise.
例外:
  `SQLException`

#### unwrap

    public <T> T unwrap(Class<T> iface)
             throws SQLException

Casts this object to the given class.

定義:
  `unwrap` インタフェース内 `Wrapper`
パラメータ:
  `iface` - The class to cast to.
戻り値:
  The casted class.
例外:
  `SQLException`