Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
and many more ....
Email address:

Exclusive Book Offers (75% off): Mastering Android Application Development, Expert Android Programming, Android High Performance Programming

Hello fellow Geeks! Today, we have some exciting news for you! Java Code Geeks and Packt have teamed up to offer you weekly discounts on their extensive library of books. This week, we are offering discounts on three books to help you understand and master Android. Check them out! Mastering Android Application Development Antonio Pachón Ruiz There are millions of ...

Read More »

Neo4j: Cypher – Property values can only be of primitive types or arrays thereof

I ran into an interesting Cypher error message earlier this week while trying to create an array property on a node which I thought I’d share. This was the Cypher query I wrote: CREATE (:Person {id: [1, "mark", 2.0]}) which results in this error: Neo.ClientError.Statement.TypeError Property values can only be of primitive types or arrays thereof. We actually are storing ...

Read More »

Using JAX-RS exceptions for status codes

java-interview-questions-answers

One way to send specific HTTP (error) status codes from a JAX-RS resource is to use the javax.ws.rs.core.Response class with its Builder Pattern-like API. If you want to specify the return type according to the response body, you can still do so and send a different status on errors by throwing a WebApplicationException. @Path("test") public class TestResource { @GET public ...

Read More »

JPA persistence.xml SQL script definitions

java-interview-questions-answers

You can define and link to SQL scripts in a JPA persistence context definition that will be executed at runtime. There are standardized properties to define scripts how to create the schema, bulk-load data and drop the schema, respectively: <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="prod" transaction-type="JTA"> <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> <property name="javax.persistence.schema-generation.create-script-source" value="create-schema.sql" /> <property name="javax.persistence.schema-generation.sql-load-script-source" value="load-data.sql" /> ...

Read More »

DAO is Yet Another OOP Shame

Someone asked me what I think about DAO and I realized that, even though I wrote about ORM, DTO, and getters, I haven’t had a chance yet to mention DAO. Here is my take on it: it’s as much of a shame as its friends—ORM, DTO, and getters. In a nutshell, a Data Access Object is an object that “provides ...

Read More »

X-Mas Musings – Eclipse to IntelliJ

December is for many people a period of reflection or thought. So I decided to reflect upon last year’s things and thoughts — each day until Christmas. This is day 5. I switched to IntelliJ IDEA this year as my primary IDE after having used Eclipse all my life. Eclipse is one of best IDE’s around and I wrote earlier ...

Read More »

1% improvement

Keeping with the numerical and financial theme of the last couple of blogs I want to turn my attention to improvement and how really small improvements add up and can justify big spending. This also turns out to be the case for continual improvement and continual delivery…                   How would you like ...

Read More »