Posts

Showing posts from August, 2010

PostgreSQL bytea and oid

I came across with following issue when i'm trying to save the uploaded file in to the database as a byte array using hibernate, JPA 2.0  annotation with Postgre SQL. even though in this stage i'm pretty much new to Postgre SQL, It has two type of data types to represent the binary data or BLOB, since i'm using hibernate jpa annotations use the annotation @Lob to indicate the byte[] of data to persist as a binary data. @Lob   @Basic(fetch = FetchType.LAZY)  public byte[] getPicture() { return picture;  }    exception : java.sql.SQLException: ERROR: column "picture" is of type bytea but expression is of type oid   Then i understood the issue with the data types.but when the hibernate generating the table it creates the  column with data type "oid" , after removing this annotation it creates a table column with "bytea" data type. and i'm in doubt which would be the most suitable data type to use.   Then i found the difference be

Add Captcha to Application

When i'm searching for a Captcha API written in java to embedded with my vaadin application, i have found out SimpleCaptcha SimpleCaptcha is a framework used in generating CAPTCHA image/answer pairs for Java (J2EE, Grails, JavaFX, etc.). It is intended to be simple to implement and provide sensible defaults, while having the ability to be customized in a wide variety of ways. Example implementations are provided in Java/J2EE and Grails. Apply the simple captcha is a two step process. Captcha captcha = new Captcha . Builder ( 200 , 50 ) .addText() .addBackground() .addNoise() .gimp() .addBorder() .build();  above line would create captch image and this captcha object has  the image and the answer. now you can apply this in anywhere you need in your application. Link : http://simplecaptcha.sourceforge.net/       JCAPTCHA Stands for J ava C ompletely A utomated P ublic T est to tell C omput

Open Source NoSQL Databases

NoSQL has started as an alternative to the relational databases. Scalability has become the biggest motivation factor behind the NoSQL. Usually releational databases do not support well to the kind of horizontal scalbility that's required for large-scale social networks or cloud applications. NoSQL is a movement that aims to re-examine the way we structure data and draw attention to innovation in hopes to finding the solution to the next generation's data persistance problems. Reference and more detail please visit : NoSQL