Thursday, April 25, 2013

Validate email address in JS

Following java script function can be used to check email validation.

function checkEmail() {        

var email = document.getElementById('txtEmail');      

  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;        
   if (!filter.test(email.value)) {      
   alert('Please provide a valid email address');      
   return false;   

Wednesday, April 17, 2013

Informix set connection timeout


Above JDBC connection URL can be used for connection timeout issues in Informix database.

INFORMIXCONRETRY : connection retry times
INFORMIXCONTIME : connection time

Connection timeout can be occurred due to database slowness and after maximum connection reach.
You have to change JDBC connection URL.

Thursday, April 4, 2013

Verify HOST servers entrusted certificates in JAVA

In sometimes, it has to be trusted the certificates in JAVA client when applications are developed. This may occur when hosting URL doesn't match with certificate URL.

Following JAVA code can be used to verify host as a trusted host.

   static {

   public boolean verify(String hostname,
      sslSession) {
       if (hostname.equals("")) {
          return true;
          return false;