Java: Write to file
An easy piece of code to write to a file: BufferedWriter out = new BufferedWriter (new OutputStreamWriter(new FileOutputStream("c:\\LOGS\\MyParameter.txt"),"UTF-8")); out.write("parameter: " + parameter); …
An easy piece of code to write to a file: BufferedWriter out = new BufferedWriter (new OutputStreamWriter(new FileOutputStream("c:\\LOGS\\MyParameter.txt"),"UTF-8")); out.write("parameter: " + parameter); …
To set encoding to unicode in Tomcat, just add URIEncoding="UTF-8" in the server.xml file at the section "Connector", like the following example: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/>
The procedure below receives a SYS_RefCursor as a parameter and constructs a simple JSON in Oracle 11g: procedure get_json_fnc(P_RS_i Sys_Refcursor) is P_RS SYS_REFCURSOR; L_COLS NUMBER; L_DESC DBMS_SQL.DESC_TAB; L_CURS INTEGER; …