Skip to main content


Showing posts with the label performance

Performance Increase

Many of us passes through the same situation of having a low performance of our application. But if you follow some of the tips and tricks below you will soon realize the increase in the performance. Collections Always assign size to ArrayLists and other collections. Ex: Collection c = new ArrayList(10); Strings Always use String abc = "I love Java";instead of String abc = new String("I love Java"); JDBC Always close these statements after use: < Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("databaseUrl","username","password"); Statement stmt = conn.createStatement(); String strSql = "select * from abc"; ResultSet rs = stmt.executeQuery("strSql");// close these stmt.close(); rs.close(); conn.close(); strSql=null; Use only the required columns in select query: Select FIRSTNAME,LASTNAME from PERSON; instead of Select * from Person; JSP