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.
Vaadin and a Google Map Widget One of my major irritations with Vaadin has been its lack of support for Google Maps as a standard widget. The reality is that many commercial applications require some form of mapping feature and the lack of support for a standard Google Map widget has been a major problem. However this has changed with Version 7.x of Vaadin, a new Google Map Addon has appeared and it fills a very important gap in the Vaadin feature set. How to Use It. If you use Maven in your development process then using the Addon in your Vaadin project is very easy. Just place this dependency in your POM file and make sure you have the correct repository established for the Vaadin Add On's. <dependency> <groupId>com.vaadin.tapio</groupId> <artifactId>googlemaps</artifactId> <version>0.6.2</version> </dependency> Here is some simple code to get you started. It creates a Googl...
Amazon Web Services ( AWS ) access keys are required to make API calls for the range of AWS services. These keys can be troublesome, as the tendency is to hard code the values in your software ( which many internet examples do ) or to use configuration files which hold them in plain text. In many ways this is bad. The secret key once displayed to you ( as the user ) is never returned again, hence its importance can not be understated. However there is a way around this problem and its associated with AWS Identity Access Managemen t ( IAM ) roles and AWS EC2 Instance s. In the digram above an application hosted on an EC2 instance requires access to S3 Objects. If you use the AWS Java SDK you can create a S3 Client Object which has a constructor which receives the private and access keys. AmazonS3Client s3Client = new AmazonS3Client(AWSCredentials creds); The constructor for this client receives a AWSCredentials object which is built using the secret and access key. ...
Comments
Post a Comment