This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.

Sadashiv Borkar

Ranch Hand
+ Follow
since Jun 07, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sadashiv Borkar

hi,
Thanx for the URL the example worked fine The problem was that when i was updating i was updating a single column and as there where some columns in the table whose values should not be null.So the Cachedrowset was trying to update the other columns with null values ( I think this is incorrect way of updating for the cachedrowset it should onl update the single column without touching others or should update othersa with older values Isn't it correct to do that way )
Another thing is that the exception given by the Cachedrowset is not correct because it is difficult to understand the what went wrong.AS it almost took 2 hrs for me to solve this. As always it was giving me accept failed exception.
Now my question is
1) Is there anyway to understand what type of Exception is thrown by the Cached Rowset..??
2)My another question is
bit unrelated to above problem but related to RecordSet of java.I wanna update the table using updateRow() of the Resultset class.It doesnot work why..??
It gives me a exception saying the it doesnot support the command.
If the driver does not support scrolling and updation then how come it work with the CachedRowset.Iam using same drivers in both cases.
Please do help me.....

Iam sorry if its bit comfusing....
thanx again for the link
regards
Sada
Can anyone give me working example of using Disconnected rowset in Java .I had tried the example from sun site but it gives me acceptChanges Failed Exception when trying to update the Database..
Please HELP ITS URGENT !!!11
regards
Sada
Hi All,
Can anyone tell me how to signedan Applet for running it on web browser.I know that there are some tutorials given by SUN.But all the tutorials at the end uses appletviewer for displaying applets.How do i signed it for displaying it in web browser.If anyone give me the steps it would be very fine.
regards
Sadashiv
24 years ago
Hi All,
Whats the o/p of the following programme and why
public class Test
{
public static void main(String args[])
{
int i=0;
i = i++;
System.out.println(i);
i = i++;
System.out.println(i);
}
}
If you see above programme the o/p is 1,2 according to me but it gives me 0, 0 as o/p.
can anyone clarify why this is happening.
If you see second programme below ...
public class Test
{
public static void main(String args[])
{
int i=0;
int j = i++;
System.out.println(i);
int k = i++;
System.out.println(i);
}
}
The above programme give the results 1, 2 and not 0, 0 why..?
Please answer Urgently as I will be giving exam very soon...
bye
Sada

hi All,
This Is how you connect to the database.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection(someurl, someuserid, somepwd);
If you see above carefully that the first sentence loads the driver into the memory and second one makes a connection to the database.
Now can anyone tell me that how does the second statement knows that what driver should be used to make the database connection.
Because the second statement which makes a connection does not have any link with the first statement that is the driver being loaded.
So how does it understands which driver is being loaded whether it is a JdbcOdbcDriver or pure Oracle Driver or anyother.

Can anyone please tell how it works.
Thanx in advance...
bye Sada
24 years ago
Hi All,
Can Anyone tell me
public class Test{
public static void main(String arg[]) {
int i = 0;
System.out.println(i+++i*10);
}
}
As far as i know the answer should be 11 but iam getting 10 why..?
bye
Sada
com
Hi,
The Code will compile without error only if
1) You are having within your classpath the above mention package.
But if you donot have the above mention directory structor then it will give you a compilation error.
It is not what author what wants you to know but he wants you to know the.He basically want you to know how you two different programmers can provide same na to the packages.
Please see the JLS for the further information
7.7 Unique Package Names
Hope this will clear your doubt.
bye
take care
Sada
Hi Gautam Shah,
As you said

I don't have ANY doubts about casting conversion and all that .
I know all these things VERY WELL.

could you just explain me the reason to the same question what you have put.

code ------
class NeedStudy {}
class NOT {
public static vod main(String arg[]) {
String s = new String("gautam");
NeedStudy n = new NeedStudy();
Runnable r = (Runnable) s; // this line gives error
runnable rr = (Runnable) n; // this line will not .
}
}
why this String object s can't get cast to runnable while NeedStudy object n can be cast to Runnable.
(the line runnable rr = (Runnable) n; at run time produce classcastexception don't mind that )
my question is why String object can't get cast to Runnable even at Compile time instead NeedStudy class can.
and mind none of the class really implements Runnable .
my question is only up to compilation not for the execution.

I would be very glad if you answer this.
Thanx In Advance
bye
take care
Sada
Hi Kourosh Keshavarzi,
It was really a Fantastic Answer which cleared All my doubts.
Thanx a Million times
bye
take care
Sada
Hi Cindy,
Thanx for the explanation and the link it was really useful for me.But I think u misunderstood my question.What I donot understand that how does it convert the Strings like "KONA" and "Haze1Nut" to integer value.If you see carefully that the above values are not numbers.So does it uses the ascii value of each character for converting it into an appropriate number or what does it use for that.
Now if you see below that the following function gives you correct results.
parseInt("Kona", 27) returns 411787
parseLong("Hazelnut", 36) returns 1356099454469L
Now if I change the following radix to 10 It gives me a NumberFormatException
parseInt("Kona", 10) returns 411787
parseLong("Hazelnut", 10) returns 1356099454469L
So whats the reason For giving the number format exception.
I understand that
radiix of 10 is used for conversion odf decimal numbers .
radiix of 8 is used for the conversion of Octal numbers.
radiix of 16 is used for the conversion of hexadecimal numbers.
Then can anyone clarify what is the use of the radiix 27 and 36
for what type of numbers are they used.Iam confused.
Thanx in advance.
Sada
Hi Dave,
Thanx for the answer it was really a nice one which cleared my doubts.
bye
take care
sada
24 years ago
Hi All,
If you see the wrapper classes you will find a method called parseXX(String str, int radix)
where XX is the name of the wrapper class

Now when I read the JLS I found out the following
Byte.parseByte("A",27) returns 10 //Not in JLS
Short.parseShort("A" 27) returns 10 //Not in JLS
parseInt("Kona", 27) returns 411787
parseLong("Hazelnut", 36) returns 1356099454469L
Cna anyone please clear my doubt that what is radix 27,36...As far as i know there r only following radix(10, 16, 8 ) what's the use of this radix and how does it converts the String into an integer.Or to be specific how does it convert a String (like "Kona" and "Haze1nut") to a number(whats the methodology used?)
Hi All,
While going to JLS I found out that the java.lang.Math class is having a constructor that is a private one thats the reason we r unable to create a object of Math class.
Can anyone please clarify what is the reason for declaring the constructor as a private one when there is no function available with the help of which i can create an object.Why can't the class be an abstract class.Whats the advantage of declaring the constructor as a private against declaring the class as an abstract.
Thanx in Advance
Sada
24 years ago
Hi all,
I was just going through this questio and found that the correct ansers are b and c only and not a.

Serge Plourde
a) is true. The garbage collector runs automatically, normally. But you can "kick it so that it will work on your demand".
Here is what the API says about the gc() method of the Runtime class:
"Runs the garbage collector. Calling this method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse. When control returns from the method call, the Java Virtual Machine has made its best effort to recycle all discarded objects.
The name gc stands for "garbage collector". The Java Virtual Machine performs this recycling process automatically as needed, in a separate thread, even if the gc method is not invoked explicitly.
The method System.gc() is hte conventional and convenient means of invoking this method."

As serge has correctly said that it is mentioned in the API about the gc() method of the Runtime class that
"Runs the garbage collector. Calling this method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse. When control returns from the method call, the Java Virtual Machine has made its best effort to recycle all discarded objects.
but if you see carefully it says that it suggest and not forces the garbage collection thus cannot be invoked explicitly by the Runtime class.
I hope this is clear and correct.
cheers
Sada
I have read following in the JLS
<B>
7.2.2 Storing Packages in a Database
A host system may store packages and their compilation units and subpackages in a database.
Java allows such a database to relax the restrictions (�7.6) on compilation units in file-based implementations. For example, a system that uses a database to store packages need not enforce a maximum of one public class or interface per compilation unit. Systems that use a database must, however, provide an option to convert a Java program to a form that obeys the restrictions, for purposes of export to file-based implementations.
</B>
Can anyone tell me what exactly is this and how can we store the
Packages into database and how do i use it.Or can give me a link where i can find out the above information
Thanx in advance...

bye
Sadashiv
bye
24 years ago