Posts

Showing posts from January, 2020

product management crud test

application.properties server.port=8051 spring.datasource.url=jdbc:h2:file:~/test spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.H2Dialect # Enabling H2 Console spring.h2.console.enabled=true # Custom H2 Console URL spring.h2.console.path=/h2-console # create database schema from SQL files spring.jpa.hibernate.ddl-auto=create #Turn Statistics on and log SQL stmts spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.generate_statistics=false #logging.level.org.hibernate.type=trace #logging.level.org.hibernate.stat=debug logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n H2databaseApplication .java import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; import co...

Serialization in java

Image
What is Serialization in Java ? The process of of writing state of an object to a file called Serialization. But strictly speaking, It is the process of converting object from java supported from into file file supported form or network supported form or network supported form. By using FileOutputstream or ObjectOutputStream we can achieve serialization. Deserialization :- The process of reading state of an object from from the file is called deserialization . But strictly speaking it is process of converting an object from either file supported form or network supported into java supported form. We can serialize  to be only serializable  object. An Object is said to be serializable if and only if the corresponding class implements Serializable interface. Serializable interface is present in the java.io package. It doesn't contain any method. Its a marker interface. If we try to serialize, non-serialized object  then it will throw NotSerialzableException . Tra...