joy b chakravarty

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

Recent posts by joy b chakravarty

Found this link, it has an elegant way to achieve the functionality of Order By Col1, Col2...

http://naukribadlo.com/wordpress/delegate-comparator/
12 years ago
From what I understand the problem doesn't lie in the Between cluase

If you look at the generated query you have something like this
select this_.BRCD_DLR_NO as y0_, this_.BRCD_PART_NO as y1_,
...
where TO_CHAR(BRCD_CRTE_TIME,'YYYYMMDD')BETWEEN '20110728' AND '20110729' and y1_=?
This should have been this_.BRCD_PART_NO = ?

i think use of Projections is causing this to happen..


as I had mentioned earlier, your code is doing something like this

list.add([]{r1.c1, null, null})
list.add([]{r1.c1, r1.c2, null})
list.add([]{r1.c1, r1.c2, r1.c3})
list.add([]{r2.c1, null, null})
list.add([]{r2.c1, r2.c2, null})
list.add([]{r2.c1, r2.c2, r2.c3})



I think what you probably wanted is
list.add([]{r1.c1, r1.c2, r1.c3})
list.add([]{r2.c1, r2.c2, r2.c3})



i could find that you are creating Object array everytime in the while loop. you could create the Object array once outside the loop and keeping using the same in the loop.
Object[] resultFields=null;
while{
resultFields=new Object[colCount];



The object creation still happens inside the loop, you are just declaring the variable outside, broadening its scope.
try user.setUserId(new BigInteger(Integer.valueOf(rs.getInt("User_Id")).toString()));
It would be helpful if you could larger/complete code snippet.. what is resultList?
If its a List (deduced from the name), then looks like you are performing this action
Lets say colCount is 3
list.add([]{r1.c1, null, null})
list.add([]{r1.c1, r1.c2, null})
list.add([]{r1.c1, r1.c2, r1.c3})
list.add([]{r2.c1, null, null})
list.add([]{r2.c1, r2.c2, null})
list.add([]{r2.c1, r2.c2, r2.c3})

which really doesn't make sense to me.
I think you are missing

<bean id="commonScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
lazy-init="false">
<property name="autoStartup" value="true"/>
<property name="waitForJobsToCompleteOnShutdown" value="true"/>
<property name="triggers">
<list>
<ref bean="XXXSimpleTrigger"/>
</list>
</property>
</bean>

hope this helps
When i said Spring takes care of my needs, I didn't 'only' mean about the constructor part, it was just one of the things

use of DI, injection as follows

13 years ago
Firstly Praveen, well written!!

I think the choice would depend a lot on whether we want to extend the behavior of StudentService, personally since this class doesn't seem like a plain utility class (like Math class) I would want that other classes could extend it like



So I wouldn't want StudentService to be final, have a private constructor and I wouldn't have its methods static (Giving PrivateStudentService an opportunity to override)
So Spring takes care of my needs as it gives me a singleton (fewer objects, only 1 in case of single bean declaration), without me actually making the class singleton, thereby allowing me to have PrivateStudentService as well.
13 years ago
you could perhaps have a java-script method invoked onKeyUp (or something like that) and in that method have a ajax (async call to server) and fetch the data for auto completion.

VALUES(?,?,?,?,?,?,?,?,?,?,?)");



A ? is missing ... just check


I'm not getting that alert ..please check
also i strongly recommend you to put the missing brackets else its very confusing

if()
alert(1);
if()
alert(2);
alert(3);
alert(4)

to be honest i don't know which all alerts will popup
hope you are not having instance variables in your servlet and only using local variables
13 years ago

validateNonEmpty(this,document.getElementById('message_help')



this means helptext = document.getElementById('message_help');
and as your form has
<span id="message_help" />

helpText would never be null..

in fact you could rewrite

as