Article

Different ways to write files in Java

If you ever wanted to write a file using Java, you can find different ways to do it. Some of them are as follow: import java.io.*; class FileWrite  { public static void main(String args[]) { try{ // Create file  FileWriter fstream = new FileWriter(“out.txt”); BufferedWriter out = new BufferedWriter(fstream); out.write(“Hello Java”); //Close the output stream… Continue reading Different ways to write files in Java

Article

How to find name of a database in Oracle

You can use any of these commands: SQL> Select name from v$database; SQL> select instance_name from v$instance; SQL> select * from global_name; SQL> SELECT VALUE FROM V$PARAMETER WHERE NAME=’db_name’; SQL> select to_number(translate(substr(version,1,9),’1.$’,’1′)) from v$instance; SQL> select s.machine from v$session s where s.audsid userenv(‘sessionid’); SQL> select global_name from global_name;

Article

log4j properties / Java Wrapper Service

Log4J Debug and Trace in log4j to set here: log4jproperties It usually can be found in package/conf or some simillar path. then you set the log4j property as follow:log4j.logger.net.mycompany=TRACE,mycompany_package_log Java Wrapper Service Java wrapper service is a java package that allow you to install and run your java programs as services in windows. When looking… Continue reading log4j properties / Java Wrapper Service