Wednesday, May 21, 2008

Is There Any Reason To Get An MBA

Expert views on MBA:

Found this interesting article on Forbes.com

Arthur Blank

Education is a lifetime process. This is just one step along the way.

Tim Blixseth

That is one approach to success, but most people I know with a substantial net worth do not have one.


Otis Booth

Yes, many. Teaches the conventions by which businesses are conducted

Mark Cuban

Only if someone else is paying for it and you are going to a school where you can have a lot of fun.

Gerald Ford

Probably.

Danny Gilbert

What's an "MBA"?


Kenneth Hendricks

I don't know of any reason. I believe you can be successful without an MBA (i.e. Ted Turner and Bill Gates).


Wayne Huizenga

Yes, education is the most important thing to obtain the edge.

George Kaiser

Not for entrepreneurial business

Michael Ilitch

I don't have one myself, but I think it's a good idea today for people to get them. There's plenty to learn both in school and out. Always be open to learning.

William Moncrief

No.

Phillip Ruffin

It can't hurt but it's not essential.

Jorge Perez

Never got one, so I would not know. Nevertheless, the better the educational credentials, the greater the chance of getting a better start and the foundation to allow you to succeed.

James Sorensen

Yes, it would be nice to have the information it provides, but that is only the beginning. The real degree is earned after the formal degree.


Nice thoughts... and questions to ask yourself :)

-Nita

Tuesday, May 6, 2008

Spring Batch Update Code

Code snippet to execute batch operations using spring

Collection vBatchUtilitySlotModelCollection = batchSlotUtilityBusinessService.getCollection();
if(vBatchUtilitySlotModelCollection != null && vBatchUtilitySlotModelCollection.size()>0)
{
BatchSqlUpdate batchUpdater = new BatchSqlUpdate(getDataSource(),"UPDATE slot SET location_seq_num = ?, facility_seq_num = ? WHERE seq_num = ?");
batchUpdater.declareParameter(new SqlParameter(Types.BIGINT));
batchUpdater.declareParameter(new SqlParameter(Types.BIGINT));
batchUpdater.declareParameter(new SqlParameter(Types.BIGINT));
batchUpdater.compile();

for (Iterator iter = vBatchUtilitySlotModelCollection.iterator(); iter.hasNext(); ) {
VBatchUtilitySlotModel vBatchUtilitySlotModel = (VBatchUtilitySlotModel)iter.next();
batchUpdater.update(new Object[] {vBatchUtilitySlotModel.getLocationSeqNum(), vBatchUtilitySlotModel.getFacilitySeqNum(), vBatchUtilitySlotModel.getSeqNum()});
}
batchUpdater.flush();
}

It worked like a flash..!!!!

-Happy Coding
--Sunny

Friday, May 2, 2008

Singleton across JVM's

When you make an Object singleton, we all know its just unique per jvm or per class loader.

So what if you want to make an object unique in a clustered environment. One way of doing it is using JNDI object binding. Here is some sample code try to run on ur server.

private void jndiObjTest(){

try{
System.out.println("Teting jndi object cache");

NotchClient nc=new NotchClient("Sunny","T");

Hashtable ht = new Hashtable();
ht.put(Context.PROVIDER_URL, "http://localhost:7001");
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.REFERRAL,"throw");
InitialContext ctx = new InitialContext(ht);
ctx.bind("sam_name",nc);

System.out.println("Reading Object from JNDI lookup");
Object o=ctx.lookup("sam_name");

NotchClient n=(NotchClient)o;
System.out.println("Value of obj retrieved from jndi"+n.getName());

}catch(Exception e){
e.printStackTrace();
throw new RuntimeException(e);
}
}
Note: Please deploy the above code to ur local server to test, standalone java app wont work.

--Sunny