Sathya Prabhu

Greenhorn
+ Follow
since Mar 10, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sathya Prabhu

Hi,

I have tried tried giving absolute path also.But it doesnt work!!!
17 years ago
Hi,

I did try with
Process run= Runtime.getRuntime().exec("chmod o+w File2.csv");

But it is throwing an IOException CreateProcess Error=2.

When searched for the reason I found that error=2 indicates 'the file not found' found.

How can I tackle this?Please help!!!
17 years ago
Hi all,

I am trying out a java program which changes the file access rights of a file from read to write. But when I execute the program it is not working neither with Windows nor Unix.Can anyone of you help on this.I have given the sample program I tried for reference :

import java.io.FilePermission;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter
import java.io.FileWriter;
import java.io.PrintWriter;


public class sample {
public static void main(String args[]) throws IOException,NullPointerException,Exception {

FileReader fr = new FileReader("File1.csv");
BufferedReader br = new BufferedReader(fr);
FilePermission permission;
permission= new java.io.FilePermission("File2.csv", "write");
FileWriter fw = new FileWriter("File2.csv");
PrintWriter pw = new PrintWriter(fw);

String headerName = br.readLine().trim();
pw.println(headerName);
fw.flush();
fw.close();
pw.close();
}
}

Thanks in advance!!!
17 years ago
Thanks Stephen .... I too worked on the same....Thanks again for your time...
17 years ago
Hi,

I am creating a file using FileWriter and using that with a PrintWriter.Can anyone of you please tell me as how to assign file permissioms th the file created like write and execute?

Thanks in advance!!!
17 years ago
Hi,

The Reflection API allows Java code to examine classes and objects at run time. The new reflection classes allow you to call another class's methods dynamically at run time.

Another practical use is that many times you are not able to tell exactly which class will be instantiated, until the runtime. In these situations you want to be able to create an object through some identifier such as the name of the class. This is one of the abilities that Reflection API of Java provides.

For more information use this link.
17 years ago
Hi,

Hope u know that "Java guarantees that expressions will be evaluated left to right".

So numberOfWheels is incremented first before creating a reference to wheel. numberOfWheels gets higehr prevedence as it inside brackets.

Sathya
17 years ago
Hi,

There is no SQL query that can retrieve directly the records which you are asking for.

One alternative is using an ORDER BY clause.But one good option will be normalising ur tables!!!

Sathya
Hi,

U can grab some crisp explantions again in the following URL:


http://mindprod.com/jgloss/interfacevsabstract.html

Sathya
17 years ago
Dear Vrushali ,

SELECT statement retrieves the single-row value and store into a variable using INTO clause.So u should use an INTO clause in your statement...Try this piece :

SQL> CREATE OR REPLACE PROCEDURE selectEmp
2 AS
3 c number;
4 BEGIN
5 select count(code) into c from vrushaliemp;
6 END;
7
8 /
Aravind,

You can avoid null values while retrieving data from the table itself.All u need to do is modify the select statement using nvl function.

But you have not clearly mentioned what null values you want to avoid.Just post your problem clearly so that otehrs can help you out.
The main feature of a PreparedStatement object is that, unlike a Statement object, it is given an SQL statement when it is created. The advantage to this is that in most cases, this SQL statement will be sent to the DBMS right away, where it will be compiled. As a result, the PreparedStatement object contains not just an SQL statement, but an SQL statement that has been precompiled. This means that when the PreparedStatement is executed, the DBMS can just run the PreparedStatement 's SQL statement without having to compile it first.

A CallableStatement,on the other hand provides a way to call stored procedures in a standard way for all DBMSs. A stored procedure is stored in a database; the call to the stored procedure is what a CallableStatement object contains.

Hope this will help out in differentiating!!!