-
Mar 3rd, 2013, 09:22 PM
#1
Reverse Engineer MS SQL Server DATE field
I'm new to Spring framework & Spring Roo just been using for a month now.
I am trying to reverse engineer a MS SQL Server Database and having troubles with a Date field.
I first tried just using the default JTDS driver and it got reverse engineered as a STRING. I was expecting a java.util.Date - Is this correct? Not being a date means that he generated JSF screens don't get the Calendar assigned to input fields.
So I found this: https://jira.springsource.org/browse/ROO-2950
It suggested that you use the Microsoft JDBC driver instead of the JTDS one.
I tried this and am getting the following error in the Roo Console: javax.net.ssl.SSLSocket not found by [75].
````````````````` ENVIRONMENT `````````````
Spring Tool Suite 3.1.0
Spring Roo 1.2.2
```````````````````````````````````````````
````````````` Spring Roo Commands executed ```````````
persistence setup --provider HIBERNATE --database MSSQL
osgi start --url file:///C:\MicrosoftJDBC\sqljdbc_4.0\enu\sqljdbc4.jar
database reverse engineer --schema dbo --package ~.domain --testAutomatically --includeTables "[my names]"
`````````````````````````````````````````````````` ```
I have also tried pushing the AspectJ definition of the String date field to customise and change the field to a date. This then adjusted files via spring roo and if I look at the Create screen it now has the calendar. However the generated "List all" screen gets the following error:
type Exception report
message Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]; nested exception is java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]; nested exception is java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
javax.faces.webapp.FacesServlet.service(FacesServl et.java:229)
org.primefaces.webapp.filter.FileUploadFilter.doFi lter(FileUploadFilter.java:79)
org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:147)
org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
Obviously for this one I used the JTDS driver and subsequently ran the following Roo commands:
• web jsf setup --implementation APACHE_MYFACES --theme BLUESKY
• web jsf all --package ~.jsf
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules