Tagged: MySQL

Tomcat Logo 0

Add Connection Pool with auto connection cleanup functionality for Tomcat 7 and MySQL

Since we don’t want to use external classes or libraries to handle database connections for our web applications we should stick to what comes built-in with the container server – in my case Apache Tomcat 7 and MySQL database server. To keep the database connection pooling and cleanup functionality on...

Zend_Date and MySQL’s datetime format 5

Zend_Date and MySQL’s datetime format

Despite Zend_Date‘s power and elegance to handle all kinds of different date and time formats, it (still) lacks the ability to cope with MySQL’s datetime formated strings out-of-the-box. Thus, instead of being able to simply do something like one has to manually define MySQL’s datetime syntax, as shown in the...

Calculate next auto-increment value for MySQL tables 1

Calculate next auto-increment value for MySQL tables

Sometimes it is necessary to determine the next auto-increment value that will be used by MySQL for inserting values into tables. First off, there are several different approaches to determine it. Most people use the MAX() function and simply add 1 to the value. Although this is fine is most...