Posted In: cpanel, Database, MySQL

cpanel – Host xxx is not allowed to connect to this MySQL server

When connecting to hosted DB server from local MySQL client you may get “Host xxx is not allowed to connect to this MySQL server”. To resolve you need to add the IP to MySQL remote access hosts settings Error Open cpanel and go to Remote MySQL Add host IP

Read More

Tags:

by , on September 20th, 2017

Posted In: Apache, Commons

How to download large files using Apache commons IO

Apache IOUtils is already taking care of large files. Comments from IOUtils FileUtils.copyURLToFile

Read More

Tags:

by , on September 20th, 2017

Posted In: Java Script, jQuery

jQuery – Add dynamic rows in a table and read input values

Find all input of td inside a TR in jquery Dynamic rows example Table HTML <table id=”lwfsKvTable” class=”table table-striped table-bordered” style=”border-collapse: separate; border-spacing: 1em;” width=”100%”> <thead> <tr> <th>Key</th> <th>Value</th> </tr> </thead> </table> Code to add new row var kvtrCnt = 0; function createKvsHtmlRow() { var newRow = $(“<tr>”); var cols = “”; cols += ‘<td […]

Read More

by , on September 9th, 2017

Posted In: Hibernate

Hibernate 5 – One to Many – @JoinColumn vs mappedBy

@JoinColumn Specifies a column for joining an entity association or element collection. If the JoinColumn annotation itself is defaulted, a single join column is assumed and the default values apply. mappedBy The field that owns the relationship. Required unless the relationship is unidirectional. @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = “employer”) private Set employees […]

Read More

by , on September 4th, 2017

Posted In: Hibernate

Hibernate 5 – @GenericGenerator hilo_seqeunce

From Hibernate user guide hilo; legacy-hilo Define a custom algorithm for generating pools of values based on a single value from a table or sequence. These optimizers are not recommended for use. They are maintained (and mentioned) here simply for use by legacy applications that used these strategies previously. @GenericGenerator(name = “hilo_sequence_generator”, strategy = “org.hibernate.id.enhanced.SequenceStyleGenerator”, […]

Read More

by , on September 4th, 2017

Posted In: Apache Log4J, Hibernate, Logback, Logging, SLF4J

Hibernate 5 – print a query string with parameter values

Logging frameworks used 1. Using LOG4J slf4j-log4j12 2. Using LOGBACK 3. Using LOG4J 2X   1. Using LOG4J slf4j-log4j12 Maven slf4j-log4j12 log4j.properties Will print both BasicTypeRegistry and BasicBinder (parameter values) logs. log4j.logger.org.hibernate.type=ALL Will print only BasicBinder (parameter values) logs. log4j.logger.org.hibernate.type.descriptor.sql=trace Parameter values logs 12:52:11,376 TRACE BasicBinder:65 – binding parameter [1] as [VARCHAR] – [Abhijit] 12:52:11,376 […]

Read More

by , on September 4th, 2017

Posted In: Hibernate

Hibernate 5 – hbm2ddl.auto explained

Note – hbm2ddl.auto is a facility to do faster development and testing. This should not be used in production. hbm2ddl.auto has four options 1. validate 2. update 3. create4 4. create-drop Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the […]

Read More

by , on September 3rd, 2017

Posted In: Jackson 2X, JSON, XML

How to convert POJO to XML using Jackson library

Maven Dependency POJO Jackson 2X XmlMapper Result

Read More

by , on September 1st, 2017

Posted In: Jackson 2X, JSON, XML

How to convert XML to POJO using Jackson library

Maven Dependency POJO Jackson 2X XmlMapper Result

Read More

by , on September 1st, 2017

  • Categories