SqlUtils { public static String quote( String relation ) { String rel = relation.replaceAll( QUOTE, ( QUOTE + QUOTE ) ); return QUOTE + rel + QUOTE; }  static String quote( String relation ); static String quote( String alias, String relation ); static Set<String> getArrayAsSet( ResultSet rs, String columnLabel ); static String castToNumber( String value ); static String lower( String value ); static final String QUOTE; static final String SEPARATOR; static final String OPTION_SEP; }
@Test public void testQuote() { assertEquals( "\"Some \"\"special\"\" value\"", SqlUtils.quote( "Some \"special\" value" ) ); assertEquals( "\"Data element\"", SqlUtils.quote( "Data element" ) ); }
@Test public void testQuoteWithAlias() { assertEquals( "ougs.\"Short name\"", SqlUtils.quote( "ougs", "Short name" ) ); assertEquals( "ous.\"uid\"", SqlUtils.quote( "ous", "uid" ) ); }