Yes it is possible.
There are some packages are available for read/write package in oracle. UTL_ FILE package is used for this purpose. Using this package we can read and write OS text files via PL/SQL.
To make use of this functionality, Please do the following
1. Login as sys to DB
2. Need to create DIRECTORY in Oracle i.e. under which folder your log file will be created.
e.g.: CREATE OR REPLACE DIRECTORY DBDIR AS 'c:\plsqllog\';
3. Grant read access to the user (from where you are going to execute the procedure)
e.g: Grant read on directory dbdir to mtx5;
4. Plug in the below code in the PL/SQL Code and add debug statement wherever it is needed .
- - Declare Section in PLSQL: Declare file handler
fileHandler UTL_FILE.FILE_TYPE;
- - Body Section in PLSQL
- - Open a file for input or output with the default line size.
fileHandler := utl_file.fopen('DBDIR','NEWFILE.TXT','W');
- - DBDIR is the directory, NEWFILE.TXT is the file name, W - write mode
- - below line is debugging statement. You can put the below debug statement wherever is required.
utl_file.put_line(f1,'1. This is a test of UTL_FILE packages');
- - finally close the handler
utl_file.fclose(f1);
If you execute the PLSQL through java, debug statements will be logged. Please find attached sample PLSQL for your reference.
Hope this will be useful to everybody!!!!!!!!!
Saturday, June 19, 2010
Wednesday, June 16, 2010
Java Stored Procedure
Java is an object-oriented programming language developed by Sun Microsystems, a company best known for its high-end UNIX workstations. Modeled after C++, the Java language was designed to be small, simple, and portable across platforms and operating systems, both at the source and at the binary level, which means that Java programs (applets and applications) can run on any machine that has the Java virtual machine installed. A stored procedure is a set of Structured Query Language (SQL) statements that you assign a name to and store in a database in compiled form so that you can share it between a number of programs. In a nutshell, Java stored procedures are Java classes, stored as Oracle schema objects, made accessible to Oracle SQL and PL/SQL through call specifications. Call specifications are simply PL/SQL declarations that 'wrap' methods of Java stored in the database.Since Oracle8i, Release 1 (Oracle 8.1.5), Oracle has offered a tightly integrated Java virtual machine (JVM) that supports Oracle's database session architecture. Any database session may activate a virtually dedicated JVM during the first Java code invocation; subsequent users then benefit from this already Java-enabled session. In reality, all sessions share the same JVM code. Beginning with version 8i, the Oracle database includes a fully functional Java Virtual Machine, Oracle JVM. Out of this close relationship between Oracle and Java emerges an important technology for Oracle developers: Java stored procedures. With Java stored procedures, developers have the ability to harness the power of Java when building database applications.
Monday, June 14, 2010
Earn a lot with Fun
Everyone of us are trying to earn in some ways. Here I give you most easiest way to earn dollars. No Investment on money rather invest your time chat with people and discuss some useful topics with your friends and earn for that. It's suprising right !!! , yes you earn for just chating and discussing with your friends. This is the best online earning program you will ever see. You earn money for sharing and exchanging knowledge, discussing things, uploading pictures, solving problems and a lot more. Working on this website is as simple as using any other social networking website like facebook, orkut etc.There is no working time, you can work anytime you feel like.All money you earn will be paid every month which you can easily transfer to any bank account in your country. Now you will be eager to know for how and what to do to earn money. Start discussions about things you like or things of your field of interest or just replying or giving suggestions on discussions started by others can also earn you. Even uploading pictures will earn you. Discussions with lot of interest will help you earn more. Now you are looking out how to join just click my lot user profile. Join now start discussing and start earning. Hurry up !!!!
Thursday, June 10, 2010
Is Your Stress Affecting Your Relationship?
Stress and anxiety ruins not only your life but also that of others around you. Your behavior changes for the worse when you are anxiety-ridden. This strains your relationships with people around you. Your relationship with your spouse or partner is hit the worst by the stress in your life.Stress is something you cannot get rid of completely. However, you can always do something to beat the stress. You cannot let stress take over your life. If you can no longer take care of the stress and anxiety in your life, seek help from an anxiety therapist.
A person becomes too sensitive emotionally when he/she has an anxiety disorder. He/she may become extremely irritable and develop a pessimistic outlook towards life. Such a person will also feel restless and helpless all the time. An anxiety therapist will help him/her get rid of the feeling of helplessness.Seeking help in time is extremely important if you want to make sure you or your partner does not suffer from anxiety disorder for too long. If you notice the warning signs of anxiety in your partner, don’t blame him/her. Instead, offer to help him/her. A little understanding on your part can work wonders not only in helping your partner recover but also in strengthening your relationship.
If the stress in your life has not taken the form of a disorder yet, learn to beat it. Learn ways to manage your stress and you will be helping your relationship in the process.
Thursday, June 3, 2010
Avoiding Conflict Will Make Your Relationship Worse
Many people after the love feel that they have selected a wrong pair because of the arguments between them. Conflict is not what causes a relationship to fall apart; it is the tendency to avoid conflict that causes a couple to part ways. Yes, conflict is an essential thing which can keep the relationship still stronger. Generally a person (boy/girl) get angry or argue to the one whom they like the most. This is because they always expect something from their partner. This expectation comes as a result of relationship and when this expectation is not satisfied it leads to conflict. But most of all when you try solving the conflict your partner realise your love on him/her and the relationship between you both still get stronger.
When you argue, crib, and complain, you are actually interested in making the situation better. When you give your partner the silent treatment, you are just creating more distance between the two of you. Yes, arguments are not bad for your relationship; it is when you start avoiding them, you start making your relationship worse.Whatever be your reason of avoiding conflict – love, fear, or peace – you are not helping your relationship by keeping a distance from your differences. The differences still stay. What you need is to handle the differences in a smart way. A happy couple will handle the differences smartly; at times, it may mean visible disagreements. If you want your relationship to work, don’t ignore the differences but embrace them in a smart way. Conflict resolution is important for a good relationship.
Subscribe to:
Posts (Atom)