Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 10 of 20 10 Older Entries

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...]
Showing entries 1 to 10 of 20 10 Older Entries

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.