This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

shilpa reddy

Greenhorn
+ Follow
since Dec 12, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by shilpa reddy

Hi,
I am in the process of writing a kind of a ping application.
Essentially, given a range of ip addresses the application returns the host names associated with ip addresses that it can locate.
1) The problem is that the while the app does return host names for some ip addresses, it does not for others and just returns the ip address back for the method InetAddress().getHostName().
When these same ip addresses are pinged they time out.
If the ip address cannot be located, I would think there should be an UnknownHostException thrown, but it does not seem to be happening.
2) How does the host name get resolved given the ip address? I would think this would be using DNS servers, but the hostname was also successfully returned in a scenario where there were no dns servers running. I checked the host file on the clients and these did not have any entries either.Could any one point to relavent posts,articles here?
Thanks in advance,
Shilpa.
Hi,
How do you set Blob using JDBC? Essentially, my question is how do you create a Blob Object in java? I know you can setBlob() using a PreparedStatement as in -
PreparedStatement ps = con.preparedStatement() ;
ps.setBlob(1,Bl) -- where Bl is a blob object.
How do you create this Blob object?
Thanks,
Shilpa.
23 years ago
Thanks Cindy,
I will do that.
But is it possible to pass any command line parameters which will suppress the dos window from popping up ?
Shilpa
23 years ago
Hi,
I have the following command to execute Oracle's export utility from command line.OS is Windows 2000
Runtime.getRuntime().exec(exp user/pass@db FILE=C:\abc.dmp ) ;
However, the DOS window shows up when the process starts executing. How do I minmize the Dos window.
Any suggestions,
Thanks,
Shilpa.
23 years ago
Hi Jim,
I am trying to retrieve a system property from Windows NT environment. The following is the command passed -
String str = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(new String[]{"cmd.exe", "/cset","KEY"}).getInputStream())).readLine();
KEY the environment variable for which I am trying to retrieve the value.
This is successful except the console window seems to flash briefly.
I have tried to set echo off in the same command ,i.e -
Runtime.getRuntime().exec(new String[]{"cmd.exe", "@echo off","/cset","KEY"}. This has not worked.
Any suggestions?
Thanks.
23 years ago
Hi,
I am passing certain parameters to the os using Runtime.getRuntime.exec() method.
However the console window flashes briefly while the command gets executed.
How can I prevent this ?
Thanks in advance,
Shilpa
23 years ago
An addition to the above post, I can run the jar file by running its class.
I can do this -
java test.jar mainclass
where mainclass is the main class in test.jar
but I get a runtime exception when I do this-
java -jar test.jar.
This is using jdk1.3.
-Shilpa
23 years ago
Hi,
I have been trying to bundle up my application into a jar file using JBuilder 3.5 Deployment wizard. I am working off an Oracle data base and am using a jdbc thin driver.
The problem is that when I try to run the app I get a ClassNotFoundException for oracle.jdbc.driver.OracleDriver.
I have put classes12.zip on the classpath.If I replace the jar file with the class files of my app, without changing the rest of the classpath, the app runs fine.
I have even tried to unzip classes12.zip and added them to the jar file,but this does not help either.
Any suggestions?
Thanks in advance.
Shilpa
23 years ago
hi,
I have already posted this in the beginner forum but then got second thoughts and am reposting the question here.
I am trying to run a jar file called abc.jar.
I have 2 versions of jdk on my system - version 1.1.8 and version 1.3.
jdk 1.1.8 is set on my system classpath.I do not want to change the classpath.
The command I use to run the jar is as follows-
java -classpath C:\jdk1.3\jre\lib\rt.jar;C:\jdk1.3\jre\lib\i18n.jar;C:\jdk1.3\lib\dt.jar;C:\jdk1.3\lib\tools.jar -jar c:\abc.jar.
The error message I get is
-jar illegal argument
I think the program is picking up the 1.1.8 version.
Anyone has any suggestions about this.
Thanks ,
Shilpa
23 years ago
Hi,
I can take a shot here.
1) a is class variable. Class variables are automatically intialized during object creation if they have not been explicitly initialized
An int is initialized to 0 by default. That is why you should get a 0 when you print the value for a.This has nothing do with your constructor,since you are not initializing a in your constructor
2) The second println should have given you the memory address of the String object that you declared in your main signature.
Hope this helps.
Shilpa
23 years ago
hi,
I am trying to run a jar file called abc.jar.
I have 2 versions of jdk on my system - version 1.1.8 and version 1.3.
jdk 1.1.8 is set on my system classpath.I do not want to change the classpath.
The command I use to run the jar is as follows-
java -classpath C:\jdk1.3\jre\lib\rt.jar;C:\jdk1.3\jre\lib\i18n.jar;C:\jdk1.3\lib\dt.jar;C:\jdk1.3\lib\tools.jar --jar c:\abc.jar.
The error message I get is
-jar illegal argument
I think the program is picking up the 1.1.8 version.
Anyone has any suggestions about this.
Thanks ,
Shilpa
23 years ago
Hi,
The situation is to create a set of tables which the user can start off,for instance by clicking a button.
My take was to execute a set of .sql files sequentially which would contain the scripts to to this.
How would I do this outside the VM ?
And where can I look for the command line for SQL*Plus ?
Thanks,
Shilpa.
How would you do this ?
Obliged if you would put down some code.
Thanks,
Shilpa
Hi ,
I am trying to execute a SQL script to create some tables from my java app.
I am trying to use Runtime.
String[] cmd = new String[2];
cmd[0] ="sqlplus.exe" ;
cmd[1] = "abc.sql" ;
Process proc = Runtime.getRuntime().exec(cmd);
This spawns the SQLPlus window, but how do I run the script ?
Can this be done or do need to hardcode the create statements in my code ?
Thanks in advance.
Shilpa