Programming

Programming Tips for JDBC

Programming Tips for JDBC  a. Use DataSource whenever Possible If you have a choice, you always should use javax.sql.DataSource to get a JDBC connection. Data sources, which were introduced with JDBC 2.0, make the job of configuring a database connection and Read more…

By whatsq, ago
Programming

JavaScript DOs and DONTs

JavaScript DOs and DONTs   1.     Use Shortcut Notations:   This code [Avoid] Is the same as [Use Instead]   var lunch = new Array(); lunch[0]=’Dosa’; lunch[1]=’Roti’; lunch[2]=’Rice’; lunch[3]=’what the heck is this?’; var lunch = [    ‘Dosa’,    Read more…

By whatsq, ago
Programming

Tips for Swing UI Layout

Tips for Swing UI Layout   1. Avoid using JEditorPane and JTextPane: Most Swing components in Java 6 have a meaningful baseline. However, some seem to have no correct baseline (for no apparent good reason). JEditorPane and JTextPane are examples Read more…

By whatsq, ago
Programming

Arrays Usage Tips

‘Return zero-length arrays, not nulls’   Some APIs intentionally return a null reference to indicate that instances are unavailable. This practice can lead to denial-of-service vulnerabilities when the client code fails to explicitly handle the null return value case.   Read more…

By whatsq, ago