Class DbUtil

java.lang.Object
de.bright_side.bdbexport.bl.DbUtil

public class DbUtil
extends java.lang.Object
  • Constructor Details

  • Method Details

    • getStringListQueryResult

      public static java.util.List<java.lang.String> getStringListQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringListQueryResult

      public static java.util.List<java.lang.String> getStringListQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringListQueryResult

      public static java.util.List<java.lang.String> getStringListQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, java.lang.String param3) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringListQueryResult

      public static java.util.List<java.lang.String> getStringListQueryResult​(java.sql.Connection conn, java.lang.String sql) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringListQueryResultOfColumnWithName

      public static java.util.List<java.lang.String> getStringListQueryResultOfColumnWithName​(java.sql.Connection conn, java.lang.String sql, java.lang.String columnName) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringQueryResult

      public static java.lang.String getStringQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringQueryResult

      public static java.lang.String getStringQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringQueryResult

      public static java.lang.String getStringQueryResult​(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, java.lang.String param3) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringQueryResult

      public static java.lang.String getStringQueryResult​(java.sql.Connection conn, java.lang.String sql) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getStringQueryResultOfColumnWithName

      public static java.lang.String getStringQueryResultOfColumnWithName​(java.sql.Connection conn, java.lang.String sql, java.lang.String columnName) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getQueryResultAsSeparatedValues

      public static java.util.List<java.lang.String> getQueryResultAsSeparatedValues​(java.sql.Connection conn, java.lang.String sql, java.lang.String prefix, java.lang.String suffix, java.lang.String separator) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getTypesToBeReadAsDate

      public static java.util.SortedSet<java.lang.String> getTypesToBeReadAsDate()
    • getTypesToBeReadAsString

      public static java.util.SortedSet<java.lang.String> getTypesToBeReadAsString()
    • getTypesToBeReadAsLong

      public static java.util.SortedSet<java.lang.String> getTypesToBeReadAsLong()
    • getTypesToBeReadAsDouble

      public static java.util.SortedSet<java.lang.String> getTypesToBeReadAsDouble()
    • getTypesToBeReadAsClob

      public static java.util.SortedSet<java.lang.String> getTypesToBeReadAsClob()
    • getDateOrNullAsSQLString

      public static java.lang.String getDateOrNullAsSQLString​(java.sql.ResultSet resultSet, int columnIndex, java.text.SimpleDateFormat format, DbExporter.DbType dataBaseType) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getNullOrStringAsSQLString

      public static java.lang.String getNullOrStringAsSQLString​(java.sql.ResultSet resultSet, int columnIndex, DbExporter.DbType type) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getNullOrStringAsSQLString

      public static java.lang.String getNullOrStringAsSQLString​(java.sql.ResultSet resultSet, java.lang.String columnName, DbExporter.DbType type) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getDBString

      public static java.lang.String getDBString​(java.lang.String value, DbExporter.DbType type) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getLongOrNullAsSQLString

      public static java.lang.String getLongOrNullAsSQLString​(java.sql.ResultSet resultSet, int columnIndex) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getDoubleOrNulllAsSQLString

      public static java.lang.String getDoubleOrNulllAsSQLString​(java.sql.ResultSet resultSet, int columnIndex) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getClobOrNulllAsSQLString

      public static java.lang.String getClobOrNulllAsSQLString​(java.sql.ResultSet resultSet, int columnIndex, DbExporter.DbType type, int maximumSize) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • determineDbType

      public static DbExporter.DbType determineDbType​(java.sql.Connection connection) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • determineUserName

      public static java.lang.String determineUserName​(java.sql.Connection connection) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getPrimaryKey

      public static java.util.SortedSet<java.lang.String> getPrimaryKey​(java.sql.DatabaseMetaData dbMetaData, CatalogAndSchema catalogAndSchema, java.lang.String tableName, ReturnableValue<java.lang.String> pkName) throws java.sql.SQLException
      Throws:
      java.sql.SQLException
    • toPartsSkipFirstPart

      public static java.util.List<java.lang.String> toPartsSkipFirstPart​(java.lang.String string, int maximumLength)
    • getDbMetaDataObjectNamesSortedAlphabetically

      public static java.util.SortedSet<java.lang.String> getDbMetaDataObjectNamesSortedAlphabetically​(java.sql.Connection connection, CatalogAndSchema catalogAndSchema, java.lang.String objectTypeName) throws java.sql.SQLException
      Throws:
      java.sql.SQLException
    • determineDatabaseNameFromJdbcUrl

      public static java.lang.String determineDatabaseNameFromJdbcUrl​(java.sql.Connection connection) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • replaceEmptyWithDefaults

      public static CatalogAndSchema replaceEmptyWithDefaults​(java.sql.Connection connection, CatalogAndSchema catalogAndSchema) throws java.lang.Exception
      Throws:
      java.lang.Exception