Java Code Examples for com.mysql.cj.jdbc.Driver

The following examples show how to use com.mysql.cj.jdbc.Driver. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: quarkus   Source File: MySQLJDBCReflections.java    License: Apache License 2.0 5 votes vote down vote up
@BuildStep
void registerDriverForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {

    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, Driver.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, FailoverDnsSrvConnectionUrl.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, FailoverConnectionUrl.class.getName()));
    reflectiveClass
            .produce(new ReflectiveClassBuildItem(false, false, SingleConnectionUrl.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, LoadBalanceConnectionUrl.class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
            LoadBalanceDnsSrvConnectionUrl.class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
            ReplicationDnsSrvConnectionUrl.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, ReplicationConnectionUrl.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, XDevApiConnectionUrl.class.getName()));
    reflectiveClass.produce(
            new ReflectiveClassBuildItem(false, false, XDevApiDnsSrvConnectionUrl.class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
            com.mysql.cj.jdbc.ha.LoadBalancedAutoCommitInterceptor.class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, StandardLogger.class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, Wrapper.class.getName()));
}
 
Example 2
Source Project: lams   Source File: BaseBugReport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor for this BugReport, sets up JDBC driver used to create
 * connections.
 */
public BaseBugReport() {
    try {
        this.driver = new Driver();
    } catch (SQLException ex) {
        throw new RuntimeException(ex.toString());
    }
}
 
Example 3
Source Project: FoxTelem   Source File: BaseBugReport.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for this BugReport, sets up JDBC driver used to create
 * connections.
 */
public BaseBugReport() {
    try {
        this.driver = new Driver();
    } catch (SQLException ex) {
        throw new RuntimeException(ex.toString());
    }
}
 
Example 4
Source Project: pentaho-kettle   Source File: MySQLDatabaseMetaTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void setupBefore() throws Exception {
  nativeMeta = new MySQLDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta = new MySQLDatabaseMeta();
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  Class.forName( Driver.class.getName() );
}
 
Example 5
Source Project: lams   Source File: MiniAdmin.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new MiniAdmin, connecting using the given JDBC URL and
 * properties
 * 
 * @param jdbcUrl
 *            the JDBC URL to use
 * @param props
 *            the properties to use when connecting
 * 
 * @throws SQLException
 *             if an error occurs
 */
public MiniAdmin(String jdbcUrl, Properties props) throws SQLException {
    this.conn = (JdbcConnection) (new Driver().connect(jdbcUrl, props));
}
 
Example 6
Source Project: FoxTelem   Source File: MiniAdmin.java    License: GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create a new MiniAdmin, connecting using the given JDBC URL and
 * properties
 * 
 * @param jdbcUrl
 *            the JDBC URL to use
 * @param props
 *            the properties to use when connecting
 * 
 * @throws SQLException
 *             if an error occurs
 */
public MiniAdmin(String jdbcUrl, Properties props) throws SQLException {
    this.conn = (JdbcConnection) (new Driver().connect(jdbcUrl, props));
}