Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 20

Displaying posts with tag: jdbc (reset)

Connector/J 5.1.30 is out with Fabric support
Employee +0 Vote Up -0Vote Down

Today marks the release of several exciting pieces of software from Oracle. In addition to MySQL server 5.7.4 DMR, MySQL Fabric is out as a release candidate 1.4.2 and Connector/J 5.1.30 has full support. MySQL Fabric is a new way to implement high-availability and scale-out with MySQL server. It provides a way to group sets of servers into high-availability groups with automatic replication configuration. If scale-out is important, sharding can be defined in terms of these high-availability groups.

To use Connector/J with Fabric, you only need to add the jar to your classpath. If you are still using Java 5, you will need to manually load the com.mysql.fabric.jdbc.FabricMySQLDriver class to register the driver. Fabric-aware connections are made with a JDBC URL of the form jdbc:mysql:fabric://host:port/db. Several connection properties are available to influence the behavior of

  [Read more...]
Creating JDBC Connections Doesn't Have To Be Slow (or "not the reason to be using a pool")
Employee +4 Vote Up -0Vote Down

Hanging out in #mysql on freenode the other day, I overheard someone saying that the reason to use connection pools with MySQL is because JDBC connections are expensive to create. That is true out of the box, but mostly because the out of the box behavior of MySQL's JDBC driver is to be standards-compliant. If you know that your DBA and your developers aren't doing crazy things with the database (changing configurations without letting the developers know, going around the "standard" API calls to start/end transactions, etc), then you can get to the point where connection setup is no slower than any other API. Does this mean you shouldn't use a connection pool? NO! (more on this next week).

Here's an iterative overview of the changes made in configuration, and how they affect what queries the driver does on initialization.

First, asking the

  [Read more...]
Some Transactional Debugging Enhancements in MySQL Connector/J 5.1.15 You Should Know About
Employee +5 Vote Up -0Vote Down

If you're using Innodb and transactions with JDBC and your MySQL application, you should know about a couple of debugging features that made their way into MySQL Connector/J 5.1.15.

First, by adding "includeThreadNamesAsStatementComment=true" to your JDBC URL, you will get the current Java thread's name that is executing SQL on a given connection as a statement comment, visible in SHOW FULL PROCESSLIST output:


mysql> show full processlist;
+------+------+-----------------+------+---------+------+----------+------------------------------------------------------+
| Id   | User | Host            | db   | Command | Time | State    | Info                                                 |
+------+------+-----------------+------+---------+------+----------+------------------------------------------------------+
...

  [Read more...]
mysql jdbc connector autoReconnect=true
+0 Vote Up -0Vote Down

What makes you think jdbc autoreconnect is needed?
Application is idle for long periods at a time?
Wait_timeout too short?
Network failure or glitches?

Some good suggestions form Mark Matthews - Bug #5020

Having encountered the problem again myself today, trying to make jdbc for mysql reconnect any terminated connections using autoreconnect=true I figured out a way to work it out from the pooling side.


Introduction to the problem:

On the mysql side wait_timeout is set to default 8hrs and any connections idle for longer than that were beomg terminated despite setting the connection string to: url=jdbc:mysql://localhost:3306/dbname?autoReconnect=true. The application was thence throwing an exception.

The solution was to introduce a ping







  [Read more...]
MySQL and Java - Free Webinar on Using MySQL Connector/J
Employee_Team +1 Vote Up -0Vote Down

Mark Matthews, Todd Farmer and Rebecca Hansen are giving a free webinar tomorrow entitled: Better Java Application Scalability and Reliability Using MySQL Connector/J Features (http://mysql.com/news-and-events/web-seminars/display-537.html).

Mark is the original creator of MySQL Connector/J (http://www.mysql.com/products/connector/) and author of the book MySQL and Java Developer's Guide, Todd is the manager for the America's Support team for MySQL and Rebecca is the Product Marketing Manager for MySQL.

You only need your browser to attend; webinar is free but registration is

  [Read more...]
Three Great Beta Deliveries in One Week
Employee +0 Vote Up -0Vote Down

Three great beta deliveries in one week!

MySQL Connector/.Net 6.0.2 beta, a new version of the all-managed .NET driver for MySQL.

MySQL Connector/C++ 1.0.4 beta, a new release providing  C++ API for connecting client applications to the MySQL Server. If you know JDBC, this should be familiar to you.

MySQL Connector/C 6.0.0 beta, a new version of the C API for accessing MySQL database servers

Use them and let us know what you think.

Learn more about Connector/C++




  [Read more...]
Three Great Beta Deliveries in One Week
Employee +0 Vote Up -0Vote Down

Three great beta deliveries in one week!

MySQL Connector/.Net 6.0.2 beta, a new version of the all-managed .NET driver for MySQL.

MySQL Connector/C++ 1.0.4 beta, a new release providing  C++ API for connecting client applications to the MySQL Server. If you know JDBC, this should be familiar to you.

MySQL Connector/C 6.0.0 beta, a new version of the C API for accessing MySQL database servers

Use them and let us know what you think.

Learn more about Connector/C++




  [Read more...]
Three Great Beta Deliveries in One Week
Employee +0 Vote Up -0Vote Down

Three great beta deliveries in one week!

MySQL Connector/.Net 6.0.2 beta, a new version of the all-managed .NET driver for MySQL.

MySQL Connector/C++ 1.0.4 beta, a new release providing  C++ API for connecting client applications to the MySQL Server. If you know JDBC, this should be familiar to you.

MySQL Connector/C 6.0.0 beta, a new version of the C API for accessing MySQL database servers

Use them and let us know what you think.

Learn more about Connector/C++




  [Read more...]
MySQL Connector J and the curse of show variables
+0 Vote Up -0Vote Down

Yesterday I posted on the curse of the autocommit when using jdbc, but as sholmi commented you can also see a ton of “show variables”  statements as the connector J tries to figure what settings the database is using.   I have seen this before as well and  you can reduce these calls as well, to do so try setting the cacheServerConfiguration paramter to true, which caches the variables instead of rechecking.  The official doc says:

“Should the driver cache the results of ‘SHOW VARIABLES’ and ‘SHOW COLLATION’ on a per-URL basis?”

MySQL Connector J and the curse of Autocommit
+0 Vote Up -0Vote Down

In my travels I do a lot of analysis of the slow query and the general query logs. In many Java shops I end up seeing the most frequently called command is

set autocommit=1;

Sometimes this statement is called 300-400x more then any other statement. What’s surprising to most of these shops, is that they are leaving autocommit on… so logically they are baffled why the statement is appearing over and over again. You see by default the autocommit statement wraps the calls to the database. So if you trace the calls you will see:

set autocommit=1;
select * from sometable
set autocommit=1;

Yep, even select statements see this behavior. So what, Its a small set statement right? . But that small set statement has to traverse the network, be parsed, be executed, then return something. Lets assume that adds 2ms to your transaction, over the course of a day that’s

  [Read more...]
Accessing MySQL Database(s) with JDBC
Employee +0 Vote Up -0Vote Down

A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

        http://java.sun.com/developer/technicalArticles/mysql_java/index.html

This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

Stay tuned for the next article in this series "Using MySQL with PHP" ..

Accessing MySQL Database(s) with JDBC
Employee +0 Vote Up -0Vote Down

A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

        http://java.sun.com/developer/technicalArticles/mysql_java/index.html

This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

Stay tuned for the next article in this series "Using MySQL with PHP" ..

Accessing MySQL Database(s) with JDBC
Employee +0 Vote Up -0Vote Down

A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

        http://java.sun.com/developer/technicalArticles/mysql_java/index.html

This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

Stay tuned for the next article in this series "Using MySQL with PHP" ..

MySQL JDBC Load Balancing with MySQL Cluster
+0 Vote Up -0Vote Down

Here's a neat tip posted by Henrik Ingo from the MySQL Telecom Team

It's not really properly documented in the manual part, but I found in the changelogs, and confirmed on IRC that to do load-balancing across the SQL nodes in MySQL Cluster, you would use a different JDBC connection string with the "loadbalance" keyword added...
jdbc:mysql:loadbalance://host-1,host-2,...host-n/database?loadBalanceBlacklistTimeout=5000
How to use JDBC (Connector/J) with MySQL Cluster
Employee_Team +0 Vote Up -0Vote Down

Last week I helped a customer setup a JBoss application against MySQL Cluster. It turns out it is not immediately obvious how you should setup our JDBC connector to do loadbalancing and failover. For instance, setting the connector up for an Master-Slave setup (with MySQL Enterprise) is well documented, but not doing the same with MySQL Cluster.

It's not really properly documented in the manual part, but I found in the changelogs, and confirmed on IRC that to do load-balancing across the SQL nodes in MySQL Cluster, you would use a different JDBC connection string with the "loadbalance" keyword added...



  [Read more...]
How to use JDBC (Connector/J) with MySQL Cluster
Employee_Team +0 Vote Up -0Vote Down

Last week I helped a customer setup a JBoss application against MySQL Cluster. It turns out it is not immediately obvious how you should setup our JDBC connector to do loadbalancing and failover. For instance, setting the connector up for an Master-Slave setup (with MySQL Enterprise) is well documented, but not doing the same with MySQL Cluster.

It's not really properly documented in the manual part, but I found in the changelogs, and confirmed on IRC that to do load-balancing across the SQL nodes in MySQL Cluster, you would use a different JDBC connection string with the "loadbalance" keyword added...



  [Read more...]
How to use JDBC (Connector/J) with MySQL Cluster
Employee_Team +0 Vote Up -0Vote Down

Last week I helped a customer setup a JBoss application against MySQL Cluster. It turns out it is not immediately obvious how you should setup our JDBC connector to do loadbalancing and failover. For instance, setting the connector up for an Master-Slave setup (with MySQL Enterprise) is well documented, but not doing the same with MySQL Cluster.

It's not really properly documented in the manual part, but I found in the changelogs, and confirmed on IRC that to do load-balancing across the SQL nodes in MySQL Cluster, you would use a different JDBC connection string with the "loadbalance" keyword added...



  [Read more...]
TOTD #44: JDBC Connection Pooling for Rails on GlassFish v3
Employee +0 Vote Up -0Vote Down

TOTD #9 explained how to configure JDBC connection pooling for Rails application deployed on GlassFish v2. There are several benefits of using using the JDBC connection pools:
  • No need to create a new database connection for each Rails instance.
  • No need to specify your password in database.yml or create a hack to hide it.
  • No garbage collection of connection after each use.
And because of the above mentioned (and other reasons) an improved application performance, scalability and efficiency.
The only way to deploy a Rails application on GlassFish v2 is to create a WAR file using Warbler. That's a


  [Read more...]
New PBXT/MyBS release enables JDBC-based BLOB streaming!
+0 Vote Up -0Vote Down
This is quite a milestone for me! At last it possible to actually do some practical work with the BLOB streaming engine (MyBS)!

For this release I have completed changes to the MySQL Connector/J 5.0.7, to allow BLOB data to be transparently stored and retrieved from the MyBS BLOB repository. The new version of the driver is called MySQL Connector/J SE (streaming enabled).

Uploading a BLOB is as simple as using setBinaryStream() or setBlob() on INSERT or UPDATE. By using getBinaryStream() or getBlob() after a SELECT you get direct access to the data stream coming from the repository. More information and some examples are provided in the documentation at: http://www.blobstreaming.org/documentation.

To try this out you need to install the latest versions of PBXT and MyBS. Both are





  [Read more...]
TOTD #9: Using JDBC connection pool/JNDI name from GlassFish in Rails Application
Employee +0 Vote Up -0Vote Down

Using the instructions followed in JRuby Hack Day and taking some help from Nick, I figured out how to use the JDBC connection pools configured in GlassFish using the JNDI names.

All the commands given below are relevant for GlassFish but the same concept will work where ever you deploy your WARed up JRuby on Rails application.

  • Follow the bullet #1 and #2 from here to create a new
  •   [Read more...]
    Showing entries 1 to 20

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.