Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-806

Cannot find symbol: MariaDbPoolDataSource

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 2.6.1
    • N/A
    • pooling
    • None
    • Centos 6

    Description

      DriverManager.getConnection works perfectly. Way better performance than old mysql driver

      But I am struggling with your pool code example:

      https://mariadb.com/kb/en/pool-datasource-implementation/

      MariaDbPoolDataSource pool = new MariaDbPoolDataSource("jdbc:mariadb://server/db?user=myUser&maxPoolSize=10");

      try (Connection connection = pool.getConnection()) {
      try (Statement stmt = connection.createStatement())

      { ResultSet rs = stmt.executeQuery("SELECT CONNECTION_ID()"); rs.next(); System.out.println(rs.getLong(1)); //4489 }

      }

      I have these imports:
      import java.sql.*;
      import javax.sql.*;

      I compile as normal, but get this error:

      javac select_con_mdb_ds_pool.java
      select_con_mdb_ds_pool.java:46: error: cannot find symbol
      MariaDbPoolDataSource pool = new MariaDbPoolDataSource("jdbc:mariadb://192.168.1.155?user=xxx&password=yy&maxPoolSize=10");
      ^
      symbol: class MariaDbPoolDataSource
      location: class select_con_mdb_ds_pool
      select_con_mdb_ds_pool.java:46: error: cannot find symbol
      MariaDbPoolDataSource pool = new MariaDbPoolDataSource("jdbc:mariadb://192.168.1.155?user=xxx&password=yy&maxPoolSize=10");
      ^
      symbol: class MariaDbPoolDataSource
      location: class select_con_mdb_ds_pool
      2 errors

      I'm probably doing something stupid - any help would be appreciated!

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            Shuttlewood Richard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.