Codota Logo
DBUtil
Code IndexAdd Codota to your IDE (free)

How to use
DBUtil
in
ch.qos.logback.core.db.dialect

Best Java code snippets using ch.qos.logback.core.db.dialect.DBUtil (Showing top 20 results out of 315)

  • Common ways to obtain DBUtil
private void myMethod () {
DBUtil d =
  • Codota Iconnew DBUtil()
  • Smart code suggestions by Codota
}
origin: camunda/camunda-bpm-platform

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
 Connection connection = null;
 try {
  connection = getConnection();
  if (connection == null) {
   addWarn("Could not get a connection");
   return;
  }
  DatabaseMetaData meta = connection.getMetaData();
  DBUtil util = new DBUtil();
  util.setContext(getContext());
  supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
  supportsBatchUpdates = util.supportsBatchUpdates(meta);
  dialectCode = DBUtil.discoverSQLDialect(meta);
  addInfo("Driver name="+meta.getDriverName());
  addInfo("Driver version="+meta.getDriverVersion());
  addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys);
  
 } catch (SQLException se) {
  addWarn("Could not discover the dialect to use.", se);
 } finally {
  DBHelper.closeConnection(connection);
 }
}
origin: camunda/camunda-bpm-platform

/**
 * This method handles cases where the
 * {@link DatabaseMetaData#supportsGetGeneratedKeys} method is missing in the
 * JDBC driver implementation.
 */
public boolean supportsGetGeneratedKeys(DatabaseMetaData meta) {
 try {
  //
  // invoking JDBC 1.4 method by reflection
  //
  return ((Boolean) DatabaseMetaData.class.getMethod(
    "supportsGetGeneratedKeys", (Class[]) null).invoke(meta,
    (Object[]) null)).booleanValue();
 } catch (Throwable e) {
  addInfo("Could not call supportsGetGeneratedKeys method. This may be recoverable");
  return false;
 }
}
origin: camunda/camunda-bpm-platform

@Override
public void start() {
 if (connectionSource == null) {
  throw new IllegalStateException(
    "DBAppender cannot function without a connection source");
 }
 sqlDialect = DBUtil
   .getDialectFromCode(connectionSource.getSQLDialectCode());
 if (getGeneratedKeysMethod() != null) {
  cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
 } else {
  cnxSupportsGetGeneratedKeys = false;
 }
 cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
 if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
  throw new IllegalStateException(
    "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
 }
 // all nice and dandy on the eastern front
 super.start();
}
origin: stackoverflow.com

DBUtil dbutilObject= new DBUtil ();
 //YOUR CONNECTION VARIABLE
 Connection con1 = dbutilObject.getDBConnection();
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnnectionProperties() {
 try {
  Connection connection = getConnection();
  if (connection == null) {
   addWarn("Could not get a connection");
   return;
  }
  DatabaseMetaData meta = connection.getMetaData();
  DBUtil util = new DBUtil();
  util.setContext(getContext());
  supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
  supportsBatchUpdates = util.supportsBatchUpdates(meta);
  dialectCode = DBUtil.discoverSQLDialect(meta);
  System.out.println("Driver name="+meta.getDriverName());
  System.out.println("Driver version="+meta.getDriverVersion());
  System.out.println("supportsGetGeneratedKeys="+supportsGetGeneratedKeys);
  
 } catch (SQLException se) {
  addWarn("Could not discover the dialect to use.", se);
 }
}
origin: camunda/camunda-bpm-platform

 /**
  * This method handles cases where the
  * {@link DatabaseMetaData#supportsBatchUpdates} method is missing in the JDBC
  * driver implementation.
  */
 public boolean supportsBatchUpdates(DatabaseMetaData meta) {
  try {
   return meta.supportsBatchUpdates();
  } catch (Throwable e) {
   addInfo("Missing DatabaseMetaData.supportsBatchUpdates method.");
   return false;
  }
 }
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

@Override
public void start() {
 if (connectionSource == null) {
  throw new IllegalStateException(
    "DBAppender cannot function without a connection source");
 }
 sqlDialect = DBUtil
   .getDialectFromCode(connectionSource.getSQLDialectCode());
 if (getGeneratedKeysMethod() != null) {
  cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
 } else {
  cnxSupportsGetGeneratedKeys = false;
 }
 cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
 if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
  throw new IllegalStateException(
    "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
 }
 // all nice and dandy on the eastern front
 super.start();
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
 try {
  Connection connection = getConnection();
  if (connection == null) {
   addWarn("Could not get a connection");
   return;
  }
  DatabaseMetaData meta = connection.getMetaData();
  DBUtil util = new DBUtil();
  util.setContext(getContext());
  supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
  supportsBatchUpdates = util.supportsBatchUpdates(meta);
  dialectCode = DBUtil.discoverSQLDialect(meta);
  addInfo("Driver name="+meta.getDriverName());
  addInfo("Driver version="+meta.getDriverVersion());
  addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys);
  
 } catch (SQLException se) {
  addWarn("Could not discover the dialect to use.", se);
 }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * This method handles cases where the
 * {@link DatabaseMetaData#supportsGetGeneratedKeys} method is missing in the
 * JDBC driver implementation.
 */
public boolean supportsGetGeneratedKeys(DatabaseMetaData meta) {
  try {
    //
    // invoking JDBC 1.4 method by reflection
    //
    return ((Boolean) DatabaseMetaData.class.getMethod("supportsGetGeneratedKeys", (Class[]) null).invoke(meta, (Object[]) null)).booleanValue();
  } catch (Throwable e) {
    addInfo("Could not call supportsGetGeneratedKeys method. This may be recoverable");
    return false;
  }
}
origin: Nextdoor/bender

@Override
public void start() {
  if (connectionSource == null) {
    throw new IllegalStateException("DBAppender cannot function without a connection source");
  }
  sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode());
  if (getGeneratedKeysMethod() != null) {
    cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
  } else {
    cnxSupportsGetGeneratedKeys = false;
  }
  cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
  if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
    throw new IllegalStateException(
            "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
  }
  // all nice and dandy on the eastern front
  super.start();
}
origin: ch.qos.logback/core

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
 try {
  Connection connection = getConnection();
  if (connection == null) {
   addWarn("Could not get a connection");
   return;
  }
  DatabaseMetaData meta = connection.getMetaData();
  DBUtil util = new DBUtil();
  util.setContext(getContext());
  supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
  supportsBatchUpdates = util.supportsBatchUpdates(meta);
  dialectCode = DBUtil.discoverSQLDialect(meta);
  addInfo("Driver name="+meta.getDriverName());
  addInfo("Driver version="+meta.getDriverVersion());
  addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys);
  
 } catch (SQLException se) {
  addWarn("Could not discover the dialect to use.", se);
 }
}
origin: Nextdoor/bender

/**
 * This method handles cases where the
 * {@link DatabaseMetaData#supportsGetGeneratedKeys} method is missing in the
 * JDBC driver implementation.
 */
public boolean supportsGetGeneratedKeys(DatabaseMetaData meta) {
  try {
    //
    // invoking JDBC 1.4 method by reflection
    //
    return ((Boolean) DatabaseMetaData.class.getMethod("supportsGetGeneratedKeys", (Class[]) null).invoke(meta, (Object[]) null)).booleanValue();
  } catch (Throwable e) {
    addInfo("Could not call supportsGetGeneratedKeys method. This may be recoverable");
    return false;
  }
}
origin: io.virtdata/virtdata-lib-realer

@Override
public void start() {
  if (connectionSource == null) {
    throw new IllegalStateException("DBAppender cannot function without a connection source");
  }
  sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode());
  if (getGeneratedKeysMethod() != null) {
    cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
  } else {
    cnxSupportsGetGeneratedKeys = false;
  }
  cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
  if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
    throw new IllegalStateException(
            "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
  }
  // all nice and dandy on the eastern front
  super.start();
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
  Connection connection = null;
  try {
    connection = getConnection();
    if (connection == null) {
      addWarn("Could not get a connection");
      return;
    }
    DatabaseMetaData meta = connection.getMetaData();
    DBUtil util = new DBUtil();
    util.setContext(getContext());
    supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
    supportsBatchUpdates = util.supportsBatchUpdates(meta);
    dialectCode = DBUtil.discoverSQLDialect(meta);
    addInfo("Driver name=" + meta.getDriverName());
    addInfo("Driver version=" + meta.getDriverVersion());
    addInfo("supportsGetGeneratedKeys=" + supportsGetGeneratedKeys);
  } catch (SQLException se) {
    addWarn("Could not discover the dialect to use.", se);
  } finally {
    DBHelper.closeConnection(connection);
  }
}
origin: io.virtdata/virtdata-lib-realer

/**
 * This method handles cases where the
 * {@link DatabaseMetaData#supportsGetGeneratedKeys} method is missing in the
 * JDBC driver implementation.
 */
public boolean supportsGetGeneratedKeys(DatabaseMetaData meta) {
  try {
    //
    // invoking JDBC 1.4 method by reflection
    //
    return ((Boolean) DatabaseMetaData.class.getMethod("supportsGetGeneratedKeys", (Class[]) null).invoke(meta, (Object[]) null)).booleanValue();
  } catch (Throwable e) {
    addInfo("Could not call supportsGetGeneratedKeys method. This may be recoverable");
    return false;
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public void start() {
  if (connectionSource == null) {
    throw new IllegalStateException("DBAppender cannot function without a connection source");
  }
  sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode());
  if (getGeneratedKeysMethod() != null) {
    cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
  } else {
    cnxSupportsGetGeneratedKeys = false;
  }
  cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
  if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
    throw new IllegalStateException(
            "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
  }
  // all nice and dandy on the eastern front
  super.start();
}
origin: com.hynnet/logback-core

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
 Connection connection = null;
 try {
  connection = getConnection();
  if (connection == null) {
   addWarn("Could not get a connection");
   return;
  }
  DatabaseMetaData meta = connection.getMetaData();
  DBUtil util = new DBUtil();
  util.setContext(getContext());
  supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
  supportsBatchUpdates = util.supportsBatchUpdates(meta);
  dialectCode = DBUtil.discoverSQLDialect(meta);
  addInfo("Driver name="+meta.getDriverName());
  addInfo("Driver version="+meta.getDriverVersion());
  addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys);
  
 } catch (SQLException se) {
  addWarn("Could not discover the dialect to use.", se);
 } finally {
  DBHelper.closeConnection(connection);
 }
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

/**
 * This method handles cases where the
 * {@link DatabaseMetaData#supportsGetGeneratedKeys} method is missing in the
 * JDBC driver implementation.
 */
public boolean supportsGetGeneratedKeys(DatabaseMetaData meta) {
 try {
  //
  // invoking JDBC 1.4 method by reflection
  //
  return ((Boolean) DatabaseMetaData.class.getMethod(
    "supportsGetGeneratedKeys", (Class[]) null).invoke(meta,
    (Object[]) null)).booleanValue();
 } catch (Throwable e) {
  addInfo("Could not call supportsGetGeneratedKeys method. This may be recoverable");
  return false;
 }
}
origin: ch.qos.logback/core

@Override
public void start() {
 if (connectionSource == null) {
  throw new IllegalStateException(
    "DBAppender cannot function without a connection source");
 }
 sqlDialect = DBUtil
   .getDialectFromCode(connectionSource.getSQLDialectCode());
 if (getGeneratedKeysMethod() != null) {
  cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
 } else {
  cnxSupportsGetGeneratedKeys = false;
 }
 cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
 if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
  throw new IllegalStateException(
    "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
 }
 // all nice and dandy on the eastern front
 super.start();
}
origin: Nextdoor/bender

/**
 * Learn relevant information about this connection source.
 *
 */
public void discoverConnectionProperties() {
  Connection connection = null;
  try {
    connection = getConnection();
    if (connection == null) {
      addWarn("Could not get a connection");
      return;
    }
    DatabaseMetaData meta = connection.getMetaData();
    DBUtil util = new DBUtil();
    util.setContext(getContext());
    supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta);
    supportsBatchUpdates = util.supportsBatchUpdates(meta);
    dialectCode = DBUtil.discoverSQLDialect(meta);
    addInfo("Driver name=" + meta.getDriverName());
    addInfo("Driver version=" + meta.getDriverVersion());
    addInfo("supportsGetGeneratedKeys=" + supportsGetGeneratedKeys);
  } catch (SQLException se) {
    addWarn("Could not discover the dialect to use.", se);
  } finally {
    DBHelper.closeConnection(connection);
  }
}
ch.qos.logback.core.db.dialectDBUtil

Most used methods

  • <init>
  • addInfo
  • discoverSQLDialect
  • getDialectFromCode
  • setContext
  • supportsBatchUpdates
    This method handles cases where the DatabaseMetaData#supportsBatchUpdates method is missing in the J
  • supportsGetGeneratedKeys
    This method handles cases where the DatabaseMetaData#supportsGetGeneratedKeys method is missing in t
  • getDBConnection

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • Kernel (java.awt.image)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now