java iText phrase

The Phrase is used to combine the more than one chunks and add spacing between the lines. It is represented by com.itextpdf.text.Phrase class. The Phrase class add the line spacing. Steps: 1. Create Document instance. It represents the current document to which we are adding content. 2. Create OutputStream instance. It represents the generated pdf. … Read more

java iText chunk

The Chunk represents the smallest unit of text as a string with pre-defined font. It is represented by com.itextpdf.text.Chunk class. Note: The Chunk objects not add any space or line break. Steps: 1. Create Document instance. It represents the current document to which we are adding content. 2. Create OutputStream instance. It represents the generated … Read more

java itext document

Document represents current pdf document to which we are adding content. It is represented by com.itextpdf.text.Document class. Steps: 1. Create Document instance. It represents the current document to which we are adding content. 2. Create OutputStream instance. It represents the generated pdf. 3. Create PDFWriter instance and pass Document and OutputStream instance to its constructor. … Read more

Create pdf file in java using iText

To create a pdf file using iText jar first download the iText jar files and include in the application classpath. Steps: 1. Create Document instance. It represents the current document to which we are adding content. 2. Create OutputStream instance. It represents the generated pdf. 3. Create PDFWriter instance and pass Document and OutputStream instance … Read more

how to create jar file in eclipse

What is JAR file? JAR stands for the Java ARchive. Before discussing on JAR files let us discuss about ZIP file first. A ZIP file is file format which can store one or more files in the compressed format. ZIP files are most commonly used formats. JAR is also a compressed file format which normally … Read more

Categories Jar

Java Marker interface

Marker/Tagging Interfaces: An interface with no methods is known as a marker or tagged interface.   Why marker interface used: It provides some useful information to the JVM/compiler so that the JVM/compiler performs some special operations on it. It is used for better readability of code.  Example: Serializable, Cloneable, etc.   Syntax public interface Interface_Name … Read more

Hibernate transaction management

Transaction: A transaction is a sequence of operation which works as an atomic unit. A transaction only completes if all the operations completed successfully. A transaction has the Atomicity, Consistency, Isolation and Durability properties (ACID). Transaction interface: Transaction interface provides the facility to define the units of work or transactions. A transaction is associated with … Read more

Hibernate native SQL

Native SQL refers to the real SQL for used database. Hibernate provides the facility to use native SQL. We can create a native SQL by createSQLQuery() method of Session interface. Syntax of Hibernate native SQL which returns an object array: Query query = session.createSQLQuery(“nativeSQL”); Syntax of Hibernate native SQL which returns an entity: Query query = … Read more

Hibernate named query using annotation

Named query is a concept of using queries by name. First a query is defined and a name is assigned to it. Then it can be used anywhere by this alias name. Syntax of hibernate named query using annotation: @NamedQueries({ @NamedQuery(name = " queryName ", query = " queryString ") })@NamedQueries({ @NamedQuery(name = " queryName … Read more

Hibernate named query using xml

Named query is a concept of using queries by name. First a query is defined and a name is assigned to it. Then it can be used anywhere by this alias name. Syntax of hibernate named query using xml. <query name="queryName"> <![CDATA[queryString]]> </query><query name="queryName"> <![CDATA[queryString]]> </query> How to call a named query? We can call … Read more