Some of the most Powerful tips for java and mysql developers from most eminent people in industry


MySQL is the world's most popular open-source database, and there are a lot of Java developers who use MySQL databases in their applications. In the video above, Mark Matthews, architect for Enterprise Tools Team at Sun Microsystems, demonstrated some of the techniques that can help Java developers get more out of their applications that use MySQL.

Mark is a experienced MySQL and Java technologist. Aside from being an architect for MySQL tools at Sun, Mark is the original developer and maintainer of Connector/J, the MySQL JDBC driver.

Mark covered a number of MySQL tips for Java developers including some lesser known configuration options, connection pool settings, and some special MySQL language elements such as ON DUPLICATE KEY UPDATE.

Ref: Java SDN Channel



Rob said...

final Properties props = new Properties();

props.put("accessToUnderlyingConnectionAllowed", "true");
props.setProperty("driverClassName", "com.mysql.jdbc.Driver");

StringBuilder options = new StringBuilder();

props.setProperty("url", "jdbc:mysql://localhost:8040/test?" + options.toString());
props.setProperty("username", "root");
props.setProperty("password", "asdf");
props.setProperty("defaultAutoCommit", false);

props.setProperty("initialSize", "5"
props.setProperty("maxActive", "20");
props.setProperty("minIdle", 2");
props.setProperty("maxIdle", 4");
props.setProperty("maxWait", "30000");
props.setProperty("minEvictableIdleTimeMillis", "15000");

props.setProperty("timeBetweenEvictionRunsMillis", "5000");

// make sure conns are valid
props.setProperty("testWhileIdle, "true");
props.setProperty("validationQuery", "/* ping*/ SELECT 1");

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment