SQL SELECT Query Submitted Via Weblogic Datasource Returns Number With Different Formats. (Doc ID 1682994.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle WebLogic Server - Version 12.1.1.0 and later
Information in this document applies to any platform.

Goal

SQL SELECT query executed as below returns the number with different formats eg on WLS Server A 1,234.56 and on Weblogic Server B 1.234,56

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
props.put(Context.PROVIDER_URL, "t3://localhost:7001");
props.put(Context.SECURITY_PRINCIPAL, "weblogic");
props.put(Context.SECURITY_CREDENTIALS, "welcome1");
Context initContext = new InitialContext(props);

DataSource datasource = (javax.sql.DataSource) initContext.lookup("jdbc/scottV12gds");
Connection conn = datasource.getConnection();

Statement stmt = conn.createStatement();
stmt.execute("select 123456/10 from dual");
...

 How to force the format number to eg 1.234,56 ?

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms