Steps SimpleDateFormat - create a class that encapsulates the format of the date you are creating. Parse the date sent using the method to ensure it meets date formatting requirements. Throw a parse exception if the date is invalid. Create a sqlDate from the parsed date. Use the number of milliseconds from January 1, 1970, 00:00:00 GMT as an input into the method. This ensures the accuracy of the formed SQL date. Return the sqlDate to the method caller.
Sometimes I think I am the only Java programmer in Australia who uses the Java Framework called Vaadin. For the most part my colleagues are deeply entrenched in Spring and have no time to lift their heads out of the Spring Documentation to experiment with a different type of Framework. One of the interesting features of Vaadin is its simple, but effective SQL Container Add On . It provides a simple layer on top of a database. The add on does not provide a JPA interface into the data ( this feature is supported by a different commercial add on ) it does however provide a nice, simple object model for queries and database connections. This short blog will focus on a Table Query using the SQL Container Add On. I will create other blogs in the future describing more complex features of the Add On. The first thing you need to establish is a Connection Pool. SimpleJDBCConnectionPool connectionPool = ne...
I installed Apache Tomcat and Apache Web Server on my Amazon EC2 instance recently. On a Amazon EC2 instance you typically restrict HTTP access via port 80. Apache Tomcat default port is 8080. I had a requirement to access the Apache Tomcat management console through a HTTP connection. To achieve this you need to proxy the Apache Web Server to the Tomcat instance. The following instructions were done on a Ubuntu 12.04 instance. First enable the Apache mod_proxy module ( if not already enabled ) sudo a2enmod proxy_http To install the module you need to restart apache2 web server. sudo /etc/init.d/apache2 restart You now need to identify to Apache the sites that are available for the proxy. So, you create a file ( your choice of name ) within the sites-available folder. /etc/apache2/sites-available$ sudo nano tomcat-app_proxy The following goes in the file. <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserve...
Comments
Post a Comment