Sam Drake

Ranch Hand
+ Follow
since Jun 05, 2003
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 Sam Drake

Hi,

Is it possible for Struts tags to be more performant than equialent java code? Is there any article that details out the difference between the 2 and helps us in seeing the speed of execution of either?

Please help me.This is an urgent request.

Thanks,
Sam.
14 years ago
Hi,
Is there any problem in using final static attributes in Java. Is it a good practice or bad practice?
eg:
public static final String constant = "something";
Does compilation of such final attributes provide benefits or are they an overhead?
Please do reply..
Thanks,
Sam
14 years ago
I have a doubt on static methods and attributes of an object.
Are static method and properties inherently handling multi-threading? That is, when multiple threads simultaneously try to change value for a static property will they be synchronized themselves or do we need to add code for that.
Say I have an attribute at class level -
pirvate static BigDecimal ob = new BigDecimal();
public static void changeValue(BigDecimal obj2) {
ob.add(obj2);
.........
.........using ob to do some other changes
}
Qn is when 2 threads simulatenously call changeValue will they be synchronized if the method is declared static.
Thanks,
Sam.
14 years ago
Hi,
Where do I declare an application level variable in the Struts framework? And how do I access it in my action classes?
Thanks,
Sam.
14 years ago
Hi,
While retrieving objects from the ArrayList after storing them, will they be returned in the SAME ORDER ALWAYS? Are there any particular reasons for the same?
Thanks,
Sam.
14 years ago
Hi,
I'm converting an MS Access app to an app which has got Swing UI. (I'm a beginner to say) Is it possible to give a table like format (ie Header which has got 4-5 columns say [Item, Item Description, Category, Department] and Details in subsequent rows) inside a ListBox?
Thanks and Regards,
Sagar.
14 years ago
Hi,
I have 2 questions.
1. What is the significance of the param value 3 in -
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
inside the web.xml (deployment decriptor) ? Is it a commons-logging option?
2. The first question arises because the SystemOut.log file on the server always gives (an INFO level) log statements whenver an Action is called eg:
RequestProces I org.apache.struts.action.RequestProcessor Processing a 'POST' for path '/LoginAction'
RequestProces I org.apache.struts.action.RequestProcessor Processing a 'POST' for path '/LoginAction'
I would like to suppress this in a proper way. Can you suggest a mechanism in which I can turn this INFO level logging so that I can get rid of the above statements?
TIA,
Sam.
14 years ago
Hi,
I need to convert a DB2 date (or timestamp) to Oracle format (MM/dd/yyyy).
Please suggest the easiest method.
Thnx,
Sam.
14 years ago
Oracle/JDBC 2.0
regards,
Sam.
Hi,
But that is the inetersting part - Single inserts are working like a charm. Though it takes time, single inserts are working fine.
Any clue as to what could be going wrong?
Thanks n regards,
Sam.
Hi,
Is there a possible limit to the data given as parameters to the PreparedStatement's executeUpdate method?
Please reply.
regards,
Sam.
Hi,
I have setup the AgentController and its up and running.
For a simple java application (not J2EE and not Web Application) I try to profile it by clicking on the Profile -> Launch -> Java Process. Setup my Java application which has got a main method.
I get the error - java.lang.NoClassDefFoundError: com/eckerd/rv2/business/appservices/analysis/PullEDDBDataToOracleTable
Exception in thread "main"
What could be going wrong? Please help.
Thanks,
Sam.
There is a main in the file
14 years ago
Hi,
I'm using code to do some batch updates for a huge set of records (400,000 approx) from one table into another. So, obviously, I read from one table into a resultset and then iterate through it and insert it using the batch update mechanism.
The problem is that after say 'n' number of batch updates the update-query gives me this error - "inserted value too large for column". Now I expected this to be an error with my first table data and some fields not matching. But it is not so. If the batchsize that i use to insert is varied then the error also occurs at random record count.
eg:
If the insertbatchsize = 10; error at record# 5000
If the insertbatchsize = 100; error at record# 305000
If the insertbatchsize = 200; error at record# 332000
The code for doing batch inserting is here -
<code>
// Setting up the batch size initially
batchInsertSize = 100;
....
....
// Adding inserts to the preparedStatement
preparedStatement.addBatch();
// Keeping a count of Records
countOfRecordsInBatch++;
// If number of batch inserts matches the count perform executeBatch
if (countOfRecordsInBatch % batchInsertSize == 0) {
int[] updatedRecords = preparedStatement.executeBatch();

// Commit the transaction
commitTransaction();
// Clear the statement
preparedStatement.clearBatch();
// Re-initialize the count
countOfRecordsInBatch = 0;
}
// This is called in a method yet again..and so on
</code>
Please tell me where the error is at. Please help. I have tried a lot.
Is there anything wrong or anything specific to do while doing batch inserts?
Thanks,
Sam.
Hi,
I'm having trouble accessing a datasource from WSAD 5.0 in a stand-alone program. Please note that its a stand-alone program.
The code I use is as follows -
Hashtable Parms = new Hashtable();
Parms.put(Context.INITIAL_CONTEXT_FACTORY, AnalysisConstants.INITIAL_CONTEXT_FACTORY);
Parms.put(Context.PROVIDER_URL, "iiop://remotehost:2809");
InitialContext DBContext = new InitialContext(Parms);
DBSource = (DataSource) DBContext.lookup(strJNDIName);
....
But this is giving the following exception when I run it!
java.lang.IncompatibleClassChangeError: com.ibm.CORBA.iiop.ORB method createObjectURL(Ljava/lang/String Lcom/ibm/CORBA/iiop/ObjectURL;
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java:1668)
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1427)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:368)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
Please help.
Thnx,
Sam
14 years ago
Hi,
Can anybody give me a code snippet to subtract dates in JAVA? The idea is to get the number of days between any 2 dates.
Thnx,
Sam.
14 years ago