Archives

Posts Tagged ‘java’

Full-import http://<host>:<port>/solr/dataimport?command=full-import Delta-import http://<host>:<port>/solr/dataimport?command=delta-import status http://<host>:<port>/solr/dataimport reload-config http://<host>:<port>/solr/dataimport?command=reload-config abort http://<host>:<port>/solr/dataimport?command=abort  

Jan 19th, 2012 | Filed under java
Tags: ,

I found an interesting link which helped me to speed up the eclipse loading time. Let me know if that helped you.

Nov 8th, 2011 | Filed under java, linux

Using JNDI javax.naming.Context context = new javax.naming.InitialContext(); javax.sql.DataSource ds =  (javax.sql.DataSource) context.lookup(“java:comp/env/jdbc/XXXJNDINAMEXXX”); java.sql.Connection con = ds.getConnection();

Jan 14th, 2009 | Filed under java, oracle
Tags: , ,

The only way I could figure out to get the distinct list using Hibernate Criteria is by using ResultTransformer function. eg. List result = session.createCriteria(Order.class)         .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)         ——-         .list(); The con is it fetches all the objects and then filters it. (very time consuming) The only way to circumvent this problem is to write query using […]

Apr 3rd, 2008 | Filed under hibernate, java

public String replaceAll(String regex, String replacement) This method works fine if replacement string does not contain ‘$’ or ‘/’ characters.If replacement string contains these characters, the results can be in-accurate. Fix: Use Matcher.quoteReplacement(replacement) public String replaceAll(String regex,         Matcher.quoteReplacement(replacement))

Mar 12th, 2008 | Filed under java
Tags:

For System Wide settings To see the settings for maximum open files for the OS level, use following command. cat /proc/sys/fs/file-max This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file. […]

Jan 18th, 2008 | Filed under java, linux
Tags: ,

for original post go here. Strong references First I need to start with a refresher on strong references. A strong reference is an ordinary Java reference, the kind you use every day. For example, the code: StringBuffer buffer = new StringBuffer(); creates a new StringBuffer() and stores a strong reference to it in the variable […]

Oct 24th, 2007 | Filed under java
Tags:

Using the in-built zip function of java, attached is a sample code to copy a folder and all its sub-folders into a zip file. Java Program to Zip a folder This program uses Commons IO – IOUtils library to copy files.

Sep 18th, 2007 | Filed under java
Tags:

Google provides a feed url to check your new mail(s) in your inbox. The url is https://gmail.google.com/gmail/feed/atom. You would need to authenticate first with your gmail username and password and it will list the unread email(s). I was reading about Rome and thought to write a small program utilizing its features to read my gmail […]

Sep 17th, 2007 | Filed under java
Tags: ,

Struts uses ActionForm to both populate a HTML form, and then to capture the parameters when a form is submitted. When a request is submitted, the ActionServlet matches the URI for the request against the path of an action-mapping. If there is a form-bean for that action-mapping, it looks for an ActionForm under the form-bean […]

Aug 17th, 2007 | Filed under struts
Tags: ,