Getting JsonGenerator settings

This post explains how to get JsonGenerator settings. JsonGenerator class obtained from JsonFactory is responsible for writing json data as a stream instead of constructing an entire object model in memory and then writing to destination. The list of settings that can be turned on or off are present in an enumeration JsonGenerator.Feature. The below…… Continue reading Getting JsonGenerator settings

Executing sql statements as a batch through hibernate

They are two ways to execute sql statements as batch in hibernate, which are 1) Work 2) ReturningWork This approach is useful when we want to perform batch operations directly on the database instead of indirectly through hibernate. First we will implement the Work interface as shown below JdbcWork class JdbcWork implements Work { private…… Continue reading Executing sql statements as a batch through hibernate

Getting access to all printers configured in machine

This post explains how to programmatically get access to all printers configured in a machine. Java provides lookup facitlity through PrintServiceLookup class. This class has static methods through which we can get a reference to all the printers. We use the lookupPrintServices method in the PrintServiceLookup class. The api definition is as shown below public…… Continue reading Getting access to all printers configured in machine