public class Test {

	private static String getSchemaName(String tableName)
	{
        if ( tableName.indexOf('.') > 0 )
            return tableName.substring( 0, tableName.indexOf('.') );

        return "public";
	}

	private static String getTableName(String tableName)
	{
		if ( tableName.indexOf('.') > 0 )
			return tableName.substring( tableName.indexOf('.')+1 );

		return tableName;
	}

	public static void main(String[] args)
	{
		String tableName = "test";
		System.out.println("schema=" + Test.getSchemaName(tableName) + ",table=" + Test.getTableName(tableName));

		tableName = "public.t2";
		System.out.println("schema=" + Test.getSchemaName(tableName) + ",table=" + Test.getTableName(tableName));
		
	}
}
