This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

awad saleh

Greenhorn
+ Follow
since Jul 04, 2007
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 awad saleh

Hi bala Sadhasivam,

I got to know why i was not getting updatable resultset.

Hint:
There is a simple way to determine if your query will probably produce a scroll-sensitive or updatable result set: If you can legally add a ROWID column to the query list, then the query is probably suitable for either a scroll-sensitive or an updatable result set. (You can try this out using SQL*Plus, for example.)


Here in the below code i was not specifying the columns , only i was using * so i was not getting updatable resultset Object.

ResultSet resultSet=statement.executeQuery("select * from item"); //

Instead of using * ,we should write the query in this form i.e; "SELECT CHARGE_PER_DAY FROM ITEM";

I GOT THE SOLUTION FROM THIS LINK
http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/resltset.htm


Regards,

Awad.
Hi Balu Sadhasivam,
I mean when even i am doing updating the column value using below code in the current result set it is throwing an exception. Though i am creating a statement with

ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE .



resultSet.updateInt("CHARGE_PER_DAY",500); // Throwing an exception while executing this line.




Hope you understand....


Regards,
Awad

Hello Java Ranch Masters,

I have created a Statement object that will generate ResultSet object with the given type and concurrency.
But when i m trying to update the resultset object is given DataAccessException.. Why I m getting ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READONLY
resultSet though i have made it ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE...??

I m using oracle XE database.........

Please given the solution for it......


Connection connection = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection("jdbcracle:thin:@newideas:1521racle","cold","storage");
DatabaseMetaData dmd= connection.getMetaData();
Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet resultSet=statement.executeQuery("select * from item");

System.out.println("type "+resultSet.getType());
System.out.println("concurancy "+resultSet.getConcurrency());


resultSet.first();
resultSet.updateInt("CHARGE_PER_DAY",500);



resultSet.updateRow();
}
catch (Exception e)
{
e.printStackTrace();
}




Hello all, In the below code i m passing the array reference to the method
increment.Modifying the reference is effecting the object in array.?
would any one explain me how array is working here..?
public class ArrayTest{
public static void main(String[] args){
int[] a = {1};
ArrayTest t = new ArrayTest();
t.increment(a);
System.out.println(a[a.length - 1]);
}
void increment(int[] i){
i[i.length - 1]++;
}
}


[ December 26, 2008: Message edited by: awad saleh ]
I really Thanks allot Harvinder Thakur AND sudipto shekhar and all others.......
[ December 26, 2008: Message edited by: awad saleh ]
how to calculate minutes and seconds from media file in j2me
9 years ago
How to play videos on J2me application using RTP.....
9 years ago
In the properties, select java compiler and change the jdk compliance level to 1.3 or 1.4
9 years ago
Hello everyone..

As we know we create an object of interface. Then why the below program is getting executed..?
I need an explanation how it is getting executed.....?


public class Test {
public static void main(String[] args) {
new Thread(new Runnable() {
public void run() {
System.out.println("Hello!");
}
}).start();
}
}


Thank Q.
i m not satisfied with your answer..

i want to know when there is now constructor in the thread class which accepts the parameter of type Thread . Then how this program is getting executed.......?

I will answer. Correct me if i m wrong.
bartenders please watch this topic and Correct me........

My Ans:-)As There are many overloaded constructors in Thread class and there's one Constructor that accepts one parameter as runnable . And as Thread Class implements runnable so we can pass parameter of type Thread which means a runnable object..

Bartenders please correct if m wrong..
hello Friends.....

1>public class Test {
2> public static void main(String[] args) {
3> System.out.print("A ");
4>Thread t=new Thread();//Creating an object of type thread
5> new Thread(t).start();
6> System.out.println("B");
}
}

In the above program i am creating an object of type thread .
and in line 5 i m passing the object while creating another object as parameter.
Now my doubt is As there is no construct in thread class that accepts parameter of the type thread. then how is program is getting executed?
hello.....
if you have installed editplus, then you have to follow this steps to give the path of your jdk.1.6:-
1. Click on the tools and select preferences
2. Click Add Tools button and select program. Give Program name in Menu text(ex: compile).
3. In Command Field select the path of the compiler(Ex:C:\Program Files\Java\jdk1.5.0_05\bin\javac.exe).
4. In Arguments field click on file name.
5.In Initial Directory field click on file directory.
6.mark options capture output and save open file and select apply.
7.repeat step 2 for adding a new program .(ex: Run)
8.then repeat step 3.(ex: C:\Program Files\Java\jdk1.5.0_05\bin\java.exe). here we select java.exe, not javac.exe.
9.In Arguments field click on file name without extension.
10.repeat step 5 and 6.
11. select View from main option and mark on user toolbar.
12. Ctr+1 for compilation and ctr+2 for running .




now you can run and compile the programs
Hello,

How can it be said that a language is perfectly object oriented programming?
And java is not a pure object oriented programming? how ?
[ August 30, 2007: Message edited by: awad saleh ]
11 years ago
hi all,

What is the difference between Driver and DriverManager?