Nikhil Goel

Ranch Hand
+ Follow
since Jul 11, 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 Nikhil Goel

Arrays can be used in Stored Procedures . Oracle has a data type VARRAY that supports this .

Whole flow of usage is :-
-Define/Create a VARRAY of any primitive data type like integers/varchar2 in ORACLE .
-Use this VARRAY type as a INOUT type in the signature of SP .
-Set the Array type through any Statement object in JDBC .
-Manipulate this ARRAY in SP .
-Get the ARRAY back .

VARRAY is supported in ORACLE . DB2/Sybase have temp tables . SQL Server not sure
I am not sure as Class Loading works in a hirearchial way and also it is APP Server dependent . Normally all commercial available APP Servers have there own class loading mechanism.
Anyway please have a look at this

http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/ClassLoaderReference.html

WebLogic Class might have implemented this interface .

Please do let me know if you find some other solutions .
17 years ago
All ,
I came across REST as the new mantra for WEB SERVICES . Can somebody throw light on it . Is it same as JAXWS*.

Heard that AXIS 2.0 has started supporting it . Also AMAZON has 90% WEB SERVICES as REST.

Some good book or link on how to implement this style of WEB SERVICES would be of great help .
[ October 09, 2006: Message edited by: Bear Bibeault ]
17 years ago
Brian,
Value objects(VAO) are just Plain old java objects for coarse grained access and hence anyway there are efficient in usage .
But your problem seems to be involve lot of network traffic and hence VAO's will be a good option .

VAO's are just objects and dataacess code to populate and transfer them over network has to be developed . Which I pressume you might be already having.

Now coming to your problem Hibernate provides the same functionality that I just mentioned above.

Hibernate provides caching of SQL statements and provides an OR mapping solution. In case of OR solution you will get POJO's of data and you don't need to write VAO's ..

Hence Hibernate anyway is a better solution . Also from your point of view no need to rewrite the code to make it Hibernate compliant as Hibernate does runtime byte code modification . What it means is your existing code can be made Hibernate compliant with no changes . Only some chnages in config needs to be done ....

Hope it helps
-nikhil
17 years ago
Code mentioned by you raise ClassCastException as Parent can't be typecasted to child class .

This version returns you 42

class parent
{
public static int i()
{
return 42;
}

}
class child extends parent

{
int i;

public static void main(String [] args)
{

parent c = new child();
child t =(child)c;
System.out.println(t.i());


}

}


Static methods can't be over riden as they are class level not object level . Hence the problem of your code was wrong typecasting not static over ridding
static blocks are intialized the first thing even way before constructors.

Usage can be to intialize connection pools etc . Normall all other utility stuff can be taken care in static blocks
17 years ago
First are we here talking about the same data thas was updated and inserted . If 'Yes' then the get method needs to be also put in the transaction .
You have to use the same transactions attribute for get as other 2 methods use . This is weird but no way out .

One imp thing u need to take care while doing is ISOLATION . As you want the same record back setting right isloation level is the trick here.
What they would be meaning is that after calling login Web Service call.invoke() is returning a cookie as output message from Web Service . You need to grab that like
String cookie = (String) call.invoke(actualArgs for the login web service);
System.out.println("cookie= " + cookie);


You need to see what app server you are working with as HttpServletRequest has only 2 methods getHeaderNames() that returns an enumeration and other one getHeader(<<header name).

So the soln is
1)Get the cookie as explained above
2)Ask the administrator under what header value they want this cookie value to be set.
3)Also look into the API of App/Web Server they might have given some HttpHeader class that you need to call some setter() on that class to set the header name and value(cookie).
Static methods are class levele methods and hence can't be over ridden . OOPS concepts like inheritance work on objects not on classes .
static is provided so that you don't need to create objects of the class . If objects aren't created then how will you have inheritance
heidi

you need to use Connection pooling reason being in a web based application you can have n number of users accessing the app hence context is not a nice idea.
Context in any application servers, applications are used for the properties,values that remain same through out the life of an application and also applications interact with servers through context .

thnks
Nikhil
17 years ago
HashCode and equals are entirely 2 diff methods on Object class in JAVA . hasgcode returns a unique indentifier for the object while equals is used for comparison of 2 objects .
equals method can be overridden by all custom objects for there equality comparison . By default equals method just compares the references.
Hope it helps.
17 years ago
Zhang you are right . As according to jar specs from SUN at http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#JAR%20Manifest you can't have classpath as an attribute in a jar manifest.
Summary is ant will also not allow you to do this .

What you can do is include smaller jars in the bigger jar and then put bigger jar in the classpath .
17 years ago
Same controller can be used for deletion also . Just add a new method like delete(String empid[]) and pass all the employee id's as array in it . Final deletion logic you can add under delete() method or put in DAO.

Regarding the passing of multiple empid's from JSP page . Name all the checkbox as same and in the controller use request.getParameter(<<checkboxname>> it will return you an Array of empid's.