how to load xml,json,text files from Jquery

How to Load Xml,Json,Text files from Jqurey


where to put .propertie files in eclipse


  1. Basically, JVM  reads  the properties files from the classes folder in the Web project once we deployed into the server
  2. If we create the Web project in eclipse IDE ,we have to put the properties files in the src folder like below



so,when we deploy the above project in server, properties files will be placed in classes folder automatically


Java Project

If we create Normal Java Project properties files should be in project root folder.


Maven Project

If we create Maven Project properties files should be in resources folder.






Basically This exception occurs when we use Relationships(OneToOne,OneToMany,ManyToMany) between the Two Objects and not provide the cascade  types.

So if you get the following exception add

@ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) etc...

Exception in thread “main” org.hibernate.TransientObjectException: object references an unsaved transient instance – save the transient instance before flushing: org.shashank.Users (for Ex:)
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(
at org.hibernate.type.EntityType.getIdentifier(
at org.hibernate.type.ManyToOneType.nullSafeSet(
at org.hibernate.persister.collection.AbstractCollectionPersister.writeElement(
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(
at org.hibernate.action.CollectionRecreateAction.execute(
at org.hibernate.engine.ActionQueue.execute(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
at org.hibernate.impl.SessionImpl.flush(
at org.hibernate.impl.SessionImpl.managedFlush(
at org.hibernate.transaction.JDBCTransaction.commit(


Exact Meaning of Class.forName(); in JDBC

Before going to discuss, need to discuss about Drivers. Inorder to connect a  java Application  with database ,  we need to follow the below important steps

  1. Use any JDBC  Driver class.
  2. This JDBC Driver class has to be instantiated.
  3. And Instantiated Driver class should be Registered with DriverManager class

For Example:

Let’s take Type1-Driver(sun.jdbc.odbc.JdbcOdbcDriver) which comes with JDK by Default So Inorder to connect  a java application with  database with this driver we have to write following statements.

sun.jdbc.odbc.JdbcOdbcDriver driver=new sun.jdbc.odbc.JdbcOdbcDriver();


Ok.Then what is Class.forName(“com.Anyclass”) ? Basically Class.forName("com.Anyclass");   used to load a class. while loading a class, if that class contains static blocks, and any code which is in that static blocks,  will be executed. So if write a statement  for Ex:      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  code in static block of this driver will be executed while class is loading. All most all JDBC drivers contains static blocks and these static block contains the code to 1) Instantiate the driver class 2) Register the driver with DriverManager.

Following  is the  static block in JdbcOdbcDriver


JdbcOdbcTracer jdbcOdbcTracer= new JdbcOdbcTracer();

jdbcOdbcTracer.trace("JdbcOdbcDriver class loaded");
JdbcOdbcDriver driver=new JdbcOdbcDriver();
catch(SQLException sqlException){
           jdbcOdbcTracer.trace("Unable to register Driver");


Class.forName(“com.any.Driver”);    Internally  loads the Driver class, while loading the class

  1. It instantiates the Driver class
  2. Register the Driver class with DriverManager.