Posted on June 1, 2011, 12:26 pm, by Ilan Hazan, under
Java,
MySQL.
The Problem And The Solution While using a MySQL connection pool in Java, I received a MySQL Communications link failure Exception (see below). In order to solve communication link failure exception: I have removed JDBC property autoReconnect=true and put only the JDBC property autoReconnectForPools=true I have added the connection properties: testOnBorrow testWhileIdle timeBetweenEvictionRunsMillis minEvictableIdleTimeMillis See [...]
Posted on May 31, 2011, 12:49 pm, by Ilan Hazan, under
Java,
MySQL.
The Problem While using a MySQL connection pool in Java, I received a MySQL Connection Closed Exception (see below). The problem was that the JDBC driver was not compatible to the MySQL server version. I have used version 5.05a for both JDBC and MySQL and it solved the problem The problem is that the connection [...]
Posted on May 29, 2011, 6:17 am, by Ilan Hazan, under
Java.
* If you need to install a new version of java, download the version from java.sun * run /usr/sbin/alternatives to change the default java. If you will run the next command you will see which java versions are available: # /usr/sbin/alternatives –config java There is 1 programs which provide ‘java’. Selection Command ———————————————– *+ 1 [...]
Posted on May 27, 2011, 12:30 pm, by Ilan Hazan, under
DbUnit,
Java.
About DbUnit DbUnit is a JUnit extension (also usable with Ant) targeted at database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to [...]
Posted on April 14, 2011, 6:57 am, by Ilan Hazan, under
Java,
MySQL.
MySQL connection pool A MySQL connection pool is a pool of connections to MySQL database. Opening and maintaining a database connection for each process (or thread), is time costly (connection creation time) and wastes resources (connections). Connection pool increase the performance of (Java) applications that needs to connect to the database by reusing the connections. [...]
Posted on March 24, 2011, 7:04 am, by Ilan Hazan, under
ANT,
Java.
Apache Ant is a Java library and command-line tool that help building software. How to install: Create downloads directory if you dont have one Download tar version from http://ant.apache.org/bindownload.cgi Extract Rename the new directory as ant Insert the path into ANT_HOME Update the global PATH variable to include ANT_HOME Run the Ant script fetch.xml to [...]
Posted on January 11, 2011, 8:00 am, by Ilan Hazan, under
Java.
To create an object dynamically from the class name, you need to use a reflection. If the fully-qualified name of a class is available, it is possible to get the corresponding Class using the static method Class.forName(). However, This cannot be used for primitive types. Having the Class type, you need to use the newInstance() [...]