Let us assume you have tasks scheduled for a given day in a planner. You wish to select all tasks in the given day. The following query will serve the purpose (the DATE function does the trick)
select * from task where DATE(startdatetime) = DATE('2010-05-29');
My friend was using Tomcat and MySQL database. He had configured a datasource and as his web application was relatively new, users to his website were very less. As a result the connections were timed out after the default timeout period and exceptions were thrown.
One of the solution to avoid this scenario is to add attributes to validate the connection when borrowing.
<Context path="" reloadable="false" docBase="/home/pathtoapp">
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
maxActive="30" maxIdle="10" maxWait="4000"
username="username" password="password" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:portnum/dbname" validationQuery="SELECT 1" testOnBorrow="true" />
</Context>
To install MySQL database schema browser, SQL executor and administrator, use the following command. It gives a cool GUI for us to work with.
sudo apt-get install mysql-query-browser mysql-admin