What is the correct form for parse this date?: 2015-05-29T00:00:00+02:00 Answer Try with Notice that MM represents months, while mm represents minutes. if you want to have 24h format use HH, hh is for 12h format XXX represents time zone in format like -08:00 to add literal like T in format you need to surroun…
Use JDBC/Mysql Connector in intellij idea
I’m new in Java, and I need to establish a connection to a MySQL server (local), I have add the libraries in Intellij idea but it seems not work, the IDE can’t find the class i think… I become crazy I’m searching since two hours… I come from visual studio/c# dev environment and i…
JXLS – how to create hyperlink to Excel worksheets in workbook
I am trying to create an Excel workbook with with JXLS. I want a text hyperlink for navigating through worksheets in a workbook. I couldn’t find any helpful information online. Please give any idea or hyperlink for that can help to to solve the problem. Thanks Answer jXLS is a small and easy-to-use Java…
How to specify the JDK version in Android Studio?
Android Studio is giving me a Gradle build error that looks like this: Now it gives me these clickable prompts: And I have already downloaded and installed JDK 7. The problem is when I go to select it in the “File System” i can only find a directory named 1.6.0 JDK. Furthermore, the installation o…
Hibernate with Sql Server fail for nvarchar field with “No Dialect mapping…”
I’m using Hibernate’s JPA-Implementation to access our SQL Server 2012 database. When trying to select a nvarchar field in a native query, I get an exception “No Dialect mapping for JDBC type: -9”. It looks much like No Dialect mapping for JDBC type: -9 with Hibernate 4 and SQL Server …
Cannot load font in JRE 8
I cannot load a font from an S3 Inputstream in JRE 8. I do not have issue if a system is installed with JRE 7, JDK 7, or even JDK 8. The error that I got is I tried to load the inputstream to a temp file, but it does not help. I also tried to load a font directly
find in MongoCollection
I have a MongoCollection<Document> in which I assign a collection. I’m trying to find a user by his id. with that I’m getting an error java.lang.ClassCastException: com.mongodb.FindIterableImpl cannot be cast to org.bson.Document When I try I’m getting an error The method find(Bson, Cl…
Overflow occurs with multiplication
The above code creates overflow and doesn’t print the correct result. The above 2 lines print the correct result. My questions are- Does it matter to the compiler which I use, m2 or m3? How does java starts multiplying? Left to right or right to left? Does 24*60 gets computed first or 1000*1000? Answer …
How to de/serialize an immutable object without default constructor using ObjectMapper?
I want to serialize and deserialize an immutable object using com.fasterxml.jackson.databind.ObjectMapper. The immutable class looks like this (just 3 internal attributes, getters and constructors): However when I run this unit test: I get this exception: This exception asks me to create a default constructor…
Can anyone tell me how to test my Camel Route if I have a choice operation?
I have a Camel route that has implemented a Content based Routing EIP(Choice operation). I need to test it. I’m new to Camel. So, I’m unsure how to do it. Can anyone tell me how to test this operation. I have mentioned a sample code below that has to be tested. Answer You can simply “advice&…