Skip to content

Instantly share code, notes, and snippets.

View sathish-io's full-sized avatar

Sathish Kandasamy sathish-io

View GitHub Profile
Eclipse/STS uses windows login a/c name as a author name for any new java source file that you create. This is default settings.
Sample author section created when windows login a/c is sathish
/**
* @author sathish
*
*/
Its good pracite to show full author name.
Good article about Hibernate Caching(First-level cache vs Second-level cache)
http://www.javabeat.net/2007/10/introduction-to-hibernate-caching/
http://blog.streamlinelogic.ca/2007/03/nhibernate-cache.html
Refer some basic naming conventions while designing data base schema,
http://www.oracle-base.com/articles/misc/naming-conventions.php
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6729304326802
@sathish-io
sathish-io / Basic JDBC Test Code
Created September 3, 2013 22:17
Basic JDBC Test Code
package com.satlabs.helper;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class DBConnectionHelper {
Oracle RAC in 11g:-
Single Client Access Name (SCAN)
====================================
JDBC clients to connect to Oracle SCAN should use jdbc url - jdbc:oracle:thin:@sales1-scan:1521/oltp instead of jdbc:oracle:thin:@sales1-scan:1521:oltp
Oracle SCAN documentation for Developer view:-
http://www.oracle.com/technetwork/products/clustering/overview/scan-129069.pdf
@sathish-io
sathish-io / REST,Jersey - Content negotiation via URI extensions
Last active July 2, 2019 11:06
REST/Jersey - Content negotiation via URI extensions
If you have REST service that wanted to return both JSON & XML type, then one way is to set media type in the REST HTTP request header in "Accept" field
Setting media type in HTTP header:
GET /books/123
Accept: application/json (or application/xml)
Other way is to set the return type in URI extensions as,
GET /books/123.json - to return json format
@sathish-io
sathish-io / Linux:Count occurrences of text
Created September 18, 2013 00:56
Linux/ How to count occurrences of text in one line of text file
fgrep -o SATHISH file.txt | wc -l
Here, SATHISH is the text to count
@sathish-io
sathish-io / Add Jetty plugin to maven project
Created September 26, 2013 01:55
Add Jetty plugin to maven project
Add below under <plugins></plugins> section in the pom file
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
@sathish-io
sathish-io / wget command - to access web page in console
Created September 30, 2013 17:01
wget command - to access web page in console
To print the html page content in the console, instead of creating in file, use
wget -qO- www.google.com
@sathish-io
sathish-io / Enterprise Spring Best Practices
Created October 16, 2013 19:01
Enterprise Spring Best Practices
Enterprise Spring Best Practices
http://gordondickens.com/wordpress/2012/07/03/enterprise-spring-best-practices-part-1-project-config/