среда, 29 апреля 2015 г.

Use code generator for automation JDBC DAO creation

I'm tired of writing JDBC DAO for database access. It is tedious and repetitive work. Why can't you use JPA? Not every data model can be covered with JPA.
After some research I've found out the project Telosys tools. It allows you to generate the JDBC DAO.
What can it offer for free? It's open source :-).
It provides you an Eclipse plugin and templates. Templates can be found here.
Also it has a good documentation. About five minutes and you can find out how to use it.
What you get is a free time. 

Convert XSD to sql with Altova XmlSpy 2011

Sometimes you got a task to parse xml and load it into database. The xml conforms to xml schema.
You have to create the sql for the xsd. How to do it?
XmlSpy has the ability to convert xsd into sql. Well, it claims to support DB2.

So, the surprise was that XmlSpy uses ODBC driver. That's a big surprise. Ok.
After after some processing XmlSpy figured out the sql, but... all attributes were VARGRAPHIC.
XmlSpy allows you  to change the sql types, but it is a lot of work.

That is very strange behavior, because in XSD was already signed the standard XML schema types.
At least, I've got a start sql to work with...

вторник, 28 апреля 2015 г.

Bugs in your code

"The software industry average is 15 to 50 bugs per 1,000 lines of code."
This is quotation from the book SQL Antipatterns: Avoiding the Pitfalls of Database Programming (p. 71).

I don't know how did they get the results, but info is rather curious.

Do you know how many bugs in you code?

понедельник, 6 апреля 2015 г.

WebSphere Application Server 8.5 Jax-rs annotations support.

WebSphere Application Server 8.5 Jax-rs supports Jackson 1.
The Jackson library is included in the runtime environment of the product. You do not need to bundle any additional libraries.

The following Jackson annotations are supported and can be used to annotation POJOs:
 
org.codehaus.jackson.annotate.JsonAnySetter
org.codehaus.jackson.annotate.JsonAutoDetect
org.codehaus.jackson.annotate.JsonClass
org.codehaus.jackson.annotate.JsonContentClass
org.codehaus.jackson.annotate.JsonCreator
org.codehaus.jackson.annotate.JsonGetter
org.codehaus.jackson.annotate.JsonIgnore
org.codehaus.jackson.annotate.JsonIgnoreProperties
org.codehaus.jackson.annotate.JsonKeyClass
org.codehaus.jackson.annotate.JsonProperty
org.codehaus.jackson.annotate.JsonPropertyOrder
org.codehaus.jackson.annotate.JsonSetter
org.codehaus.jackson.annotate.JsonSubTypes
org.codehaus.jackson.annotate.JsonSubTypes.Type
org.codehaus.jackson.annotate.JsonTypeInfo
org.codehaus.jackson.annotate.JsonTypeName
org.codehaus.jackson.annotate.JsonValue
org.codehaus.jackson.annotate.JsonWriteNullProperties
org.codehaus.jackson.map.annotate.JsonCachable
org.codehaus.jackson.map.annotate.JsonDeserialize
org.codehaus.jackson.map.annotate.JsonSerialize
org.codehaus.jackson.map.annotate.JsonTypeIdResolver
org.codehaus.jackson.map.annotate.JsonTypeResolver
org.codehaus.jackson.map.annotate.JsonView