This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!

A Agrawal

Ranch Hand
+ Follow
since Jul 13, 2001
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 A Agrawal

Dear Carl,
I know I am talking to Sheriff, but I don�t think there is any problem with my User Name.

1) From Your mail:
�We require names to have at least two words, separated by a space,�
In my case: Yes. It Is.
2) From Registration Screen:
�No commas or underscores, and the last name must be more than one letter�
In My case: Yes. It Is.
More over I give my complete name and location in my signature so where is the problem and The User name I have given here is the Name, I am known even in my co. Still If you think its not acceptable please feel free to go ahead and ban my Id, I promise not to come back.

Originally posted by Carl Trusiak:
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, which you agreed to when you registered, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.



------------------
Amit Agrawal,
New Delhi, India.
18 years ago
:(
Where is TinTin By the way ? Hope he is reading (and can read !!) these.........
[This message has been edited by A Agrawal (edited August 17, 2001).]
18 years ago
I am reading from a text file and I need to change some data on run.
I mean, while reading If I encounter a particular string I need to replace it by another String.
Please suggest, which Stream/Reader I can/should use for this purpose.
Thks.
------------------
Amit Agrawal,
New Delhi, India.
18 years ago
Hi...
Actually You would need to change your architecture a bit...In case of Transaction don't return the connection back to pool, keep it in some hashtable [maintained by a singleton (i.e. single instance class) on server] keeping some ID (say ContextId) as key and connection as value.
maintain this ContextId at client end...next time you need the connection to continue/commit/rollback the transaction, take it from the hashmap on the basis of Id your client prgm is passing.
do watever you want to do with this connection and return it to the pool only when you are done.
and yes don't forget to turn autocommit property false before you start using connection for a transaction. also keep contextid unique.
hope this helps.

------------------
Amit Agrawal,
New Delhi, India.
[This message has been edited by A Agrawal (edited August 16, 2001).]
I support Vishakha. One more similarity between Iterator and ResultSet is memory. They don't have their own memory and they just point/iterate through memory acquired by some other resource.


------------------
Amit Agrawal,
New Delhi, India.
I guess what you need is a tutorial on Internationalization. just search for this word on any search engine and you would get enough material to go through.

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
I agree Cindy but that's where I am struck.
Orcale provide very neat classes in its driver with proper names like OracleStatemnet, OracleConnection etc...so one can easily locate such things...
but SQL Server's Driver has classes like a.class, b.class ...up to z.class with many inner classes in each class. So I am unable to locate Oracle's equivalent in SQLServer's driver.
I posted here with the hope somebody must have faced this problem and might have got some solution to it.

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
Can anybody plz tell me what is equivalent of OracleTypes.CURSOR in case of database is SQL Server.

Actually the problem I am facing is, wat to pass as second parameter of registerOutParameter().

cstmt.registerOutParameter(3,OracleTypes.CURSOR);
// where cstmt is callable statement.

we pass OracleTypes.CURSOR when we want to retrieve ResultSet by executing a stored procedure but I am unable to find its equivalent in SQLServer.

I couldn�t locate any thing in java.sql.Types for this purpose.

(I had to import oracle.jdbc.driver.*; to get OracleTypes.CURSOR recognized).

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
Thanks Jose and Roseanne.
I think I will keep a private static variable and use it as suggested by Roseanne and as all static methods gets loaded at the time of class loading, I think it will stop getting class loaded.
Thanks.

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
How can I unload or restrict Loading of a particular class, depending upon some condition?
Actually, in the static block of a class (which has only static methods) I am reading from some property file And If there is some incorrect/missing value in property file, I want to restrict loading of my class. (or if you say that class is already loaded as static is being executed, I want to unload the same).
in simple words, I want to restrict user executing any static methods of the class if there was any problem in property file which i am reading in class's static block. (and please I don�t want to set a variable in static block and check that in every method).

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
Thanks Sean for introducing me to regex. Actually I have started using jdk1.4 but wasn't aware of its availability.
and yes, String tokenizer is another good idea...lemme explore..thanks anyway.
------------------
Amit Agrawal,
New Delhi, India.
18 years ago
Any idea how can I search a sub string from a String ignoring white spaces.
Ok, I need to Search a sub string ("for update") from a given String (henceforth Source String) but the condition is it might contain any number of white spaces between these two words (in source string).
So how can I search for "for update" in Source String ignoring any number of (but at least one) white spaces it might have in the source string.
(One way can be searching index of "for" than checking value at index+2 for "update"...and keep trying until i search through entire length of String...but I need some optimized way to do it as I need to check this virtually infinite times in my application)

------------------
Amit Agrawal,
New Delhi, India.
18 years ago
No. just Performance Diff is the only diff...otherwise both give similar results (n no extra methods in any case).

------------------
Amit Agrawal,
New Delhi, India.
If you have option of using jdbc3.0 you may also go for RowSet. which extends ResultSet.
The classes implementing RowSet (e.g. CachedRowSet) also implement Serializable. Here you get many advantages over using Vector for this purpose.

------------------
Amit Agrawal,
New Delhi, India.