Prashant Sehgal

Ranch Hand
+ Follow
since Jun 20, 2003
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 Prashant Sehgal

This might illustrate better:

Java Code:


Cmd Script: test_1.cmd


Bat Script:


I want my original program to return "this is test 2" in it's inputstream. Is it even possible?
15 years ago
The output is not getting redirected to the original terminal window. I anyway want the output to display in the a new terminal window and also to catch it in the Processes's inputstream. I'll check out the ProcessBuilder class and the article you mention as well.

But my original problem stands.

How to catch the inputstream from a new DOS window that has been created by "exec()ing" a .cmd script from within your java program.
15 years ago
Yes this is a Microsoft only deployment.
15 years ago
I have a .cmd file - say - with the following code:


I want to invoke this using Runtime.getRuntime().exec(.) and catch the "I am a command that produces a lot of text output" text in the InputStream being returned from the Process.

The problem is that I *must* start this command in a separate DOS window. In doing that, my program loses the handle to the stream and does not return any text from the command file.

So, how do I start the command in a separate window while still being able to catch all it's output in my Process's inputstream?
15 years ago
Hi,

It is said that through serialization one can persist the state of an object.

Q1- What about behaviour? When an object is serialized are only it's attributes persisited or are the methods also sent?

Q2- Adding/removing/modifying data type of an existing attribute will automatically update the serialVersionUId of the class. Will performing similar changes to methods also result in the same?

Thanks.
15 years ago
I still dont get it - cant the same thing be achieved by overriding readObject() and writeObject() of Serializable??
15 years ago
How are the fields delimited? Can you attach a sample .cer file?
15 years ago
So no replies means dumb question or dumb audience ...?
15 years ago
I know there've been plenty of discussion around this, but I could not find a satisfatory answer as to why Externalizable is really required.

I can achieve an extremely high level of customization by manually overriding readObject and writeObject methods of Serializable just as I can by overriding readExternal and writeExternal of Externaliable.

The sun documentation page on Externalizable says that...

Externalizable interface are implemented by a class to give the class complete control over the format and contents of the stream for an object and its supertypes



...but can't the same level of customization be gained by overriding Serializable?
15 years ago
Hi,

My connection factory is setup in my Jboss 4.0.4 server like this:



I'm accessing this from outside of Jboss, using a stand alone client with from it's main method like so:



The connection factory is being returned as null. I read somewhere that this might be because my connection factory is setup using jboss-ra and in such cases standalone clients cant access connection factories. One needs to access them from inside the server.

a) Is this correct?
b) If I want to retain my stand-alone client, how should I setup my connection factories?

Thanks,
Prashant.
[ April 14, 2008: Message edited by: Prashant Sehgal ]
16 years ago
Ok - figured it out from elsewhere. From global benefit, this is how you do it in Jboss:

16 years ago
Must mention here that I'm connection from within Jboss 4.0.4 like so:



Yup there's the Oracle9i in the type-mapping, 10g doesn't seem to mind it.
16 years ago
Does anyone know if it's possible to connect to a 10g RAC database using the jdbc java thin client.

I'm currently connection to a single node using "jdbc:oracle:thin:@[HOSTNAME]:[PORT]:[INSTANCE]".

Now another node is being added to make it a RAC cluster, so now there would be two different HOSTNAMEs.

How do I connect to both?
16 years ago

Originally posted by Paul Campbell:
does the JBoss user have execute privilege on the stored procedure?



It seems he (username is MIGRATE) does have privileges to execute all procedures. Because

(a) The same code runs from a standalone JDBC connection for the same user;
(b) The same user is able to call another procedure, I wrote, that just inserts dummy data into a dummy table; and
(c) Here's what I can see from the user profile in the DB: