モジュール org.nkjmlab.sorm4j

クラス H2DataSourceFactory

java.lang.Object
org.nkjmlab.sorm4j.util.h2.datasource.H2DataSourceFactory

public class H2DataSourceFactory extends Object
A factory of local data source with h2 database.
作成者:
nkjm
  • メソッドの詳細

    • getInMemoryModeJdbcUrl

      public String getInMemoryModeJdbcUrl()
    • getServerModeJdbcUrl

      public String getServerModeJdbcUrl()
    • getEmbeddedModeJdbcUrl

      public String getEmbeddedModeJdbcUrl()
    • getMixedModeJdbcUrl

      public String getMixedModeJdbcUrl()
    • getInMemoryModeJdbcUrl

      public String getInMemoryModeJdbcUrl(String... options)
    • getServerModeJdbcUrl

      public String getServerModeJdbcUrl(String... options)
    • getEmbeddedModeJdbcUrl

      public String getEmbeddedModeJdbcUrl(String... options)
    • getMixedModeJdbcUrl

      public String getMixedModeJdbcUrl(String... options)
    • createInMemoryModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createInMemoryModeDataSource()
      Creates a new sever mode connection pool for H2 databases
      戻り値:
    • createServerModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createServerModeDataSource()
      Creates a new sever mode connection pool for H2 databases
      戻り値:
    • createEmbeddedModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createEmbeddedModeDataSource()
      Creates a new embedded mode connection pool for H2 databases
      戻り値:
    • createMixedModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createMixedModeDataSource()
      Creates a new mixed mode connection pool for H2 databases
      戻り値:
    • createInMemoryModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createInMemoryModeDataSource(String... options)
      Creates a new sever mode connection pool for H2 databases
      戻り値:
    • createServerModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createServerModeDataSource(String... options)
      Creates a new sever mode connection pool for H2 databases
      戻り値:
    • createEmbeddedModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createEmbeddedModeDataSource(String... options)
      Creates a new embedded mode connection pool for H2 databases
      戻り値:
    • createMixedModeDataSource

      public org.h2.jdbcx.JdbcConnectionPool createMixedModeDataSource(String... options)
      Creates a new mixed mode connection pool for H2 databases
      戻り値:
    • makeFileDatabaseIfNotExists

      public boolean makeFileDatabaseIfNotExists()
      Make a new file database in not exists
      戻り値:
      true if and only if the directory was created,along with all necessary parent directories; false otherwise
    • getDatabaseFile

      public File getDatabaseFile()
    • getUsername

      public String getUsername()
    • getPassword

      public String getPassword()
    • getDatabaseDirectory

      public File getDatabaseDirectory()
    • getDatabaseName

      public String getDatabaseName()
    • getDatabasePath

      public String getDatabasePath()
    • builder

      public static H2DataSourceFactory.Builder builder()
    • builder

      public static H2DataSourceFactory.Builder builder(File databaseDirectory, String databaseName, String username, String password)
      Initializes a newly created H2DataSourceFactory.Builder object; you can get { LocalDataSourceFactory object via build method.

      following variables in the path of database directory will be expanded.

      • "~/" , "~\" or "%USERPROFILE%" to "user.home"
      • "%TEMP%" or "$TMPDIR" to "java.io.tmpdir"
      パラメータ:
      databaseDirectory - the directory including the database file.
      databaseName - the name of database.
      username -
      password -
    • toString

      public String toString()
      オーバーライド:
      toString クラス内 Object
    • createTemporalInMemoryDataSource

      public static DataSource createTemporalInMemoryDataSource()
      Creates temporal an in memory data source.
      戻り値: