Win a copy of Head First Android this week in the Android forum!

mangesh lele

Greenhorn
+ Follow
since Jan 17, 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 mangesh lele

I am getting Concurrent Modification Exception while iterating an arraylist, when the next method is called. I want to know how I can debug this error since my program is seemingly running in a single thread. The docs given are not really helpful in that regard.
Thanks.
17 years ago
could someone please tell me what are the reasons why a null pointer exception is thrown in a Connection prepareStatement(String) call?
I am generating the required insert statement given below and passing it to prepareStatement :
Insert into o1pay.product_pay ( AMT_LMT_DEF_CCY,.........40 odd fields ) values ( ?,........same number of question marks )
the logs are as follows:
java.sql.SQLException: java.lang.NullPointerException
at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:86)
.
.
.
.
.
.
.
furthermore, this error started happening when i moved my weblogic application setup from one database to another database, apparently identical to the first. the only thing i changed was the database url in connection pool tag of config.xml (weblogic 6.1)
thanks in advance
17 years ago
thanks a lot u guys
actually changing the database column to varchar2 is the logical solution, but i wanna try keeping it as DATE first.
there are few more restrictions, since i am working on a generic framework.
i cant change the select query, since it is created dynamically from the list of fields required.
also i think getTimeStamp will just return the time and lose the date, so cant be applied to generic code.
is there any way to wrap the whole DATE field information in GregorainCalendar?
18 years ago
i have a table with a DATE field. i want to retrieve the time information from the value stored in this field and wrap it into a GregorianCalendar object. when i use lResultSet.getDate(), it returns a java.sql.Date object having only date value but the timestamp is set to 00:00:00 (normalized, i think, as per jdk specs). is there any way i can get both the date and timestamp into my GregorianCalendar object?
18 years ago
i'm gettin a strange error while running my weblogic application
i have connection object returned by the connection pool which looks to be of weblogic.jdbc.rmi.SerialConnection class.
the problem occurs when i try to execute successive createStatement calls on the same weblogic.jdbc.rmi.SerialConnection object. it works fine for the first call but gives NullPointerException for all subsequent calls.
where can i get more information bout this NullPointerException class to know whether and how createStatement is overriden since no javadocs for this particular class seem to be in existence.
what are the possible causes of the occurrence of this NullPointerException??
18 years ago
thanks joel
i know my requirement is a pretty roundabout way of doing things and could be made lot easier, but the thing is since i'm plugging validations into an existing framework, i have to stay within its constraints.
so my real problem is that the only message that can be passed from calling class to validation class is a String object, and hence needs to be converted back and forth.
18 years ago
hi
I want to carry out validation on a GregorianCalendar instance to check if it is present in my database as a corresponding Oracle Date field
In the existing framework, the validation is done by a class which takes String argument and parses it to get a Date object (using DateFormat).
The class which calls the validation class gets the GregorianCalendar instance which is to be validated.
How can I pass a String representation of this GregorianCalendar instance to the validation class so that it can convert it back to an SQL Date object?
Sample Code:
The Validation class: -
.
.
.
.
.
public boolean checkAll(String iDate){
.
.
.
.
SimpleDateFormat sdfInput=new SimpleDateFormat("MM-dd-yyyy");

Date mDateValue = sdfInput.parse(iDate);
PreparedStatement lPreStatement.setDate(1,(java.sql.Date)mDateValue);
.
.
.
.
}

The Calling class: -
.
.
.
.
.
.
String lSomeDate; //to be populated with GregorianCalendar representation
boolean lbIsDatePresent = checkAll(lSomeDate);
.
.
.
.
Hope I havent made it too cryptic
Thanks in advance.
[ May 26, 2003: Message edited by: mangesh lele ]
18 years ago
i might be doing a project on image processing; dont know the exact functionality yet, but from what i gather it has something to do with image histograms and color vectors of jpeg files; basically its about feature extraction of those color vectors using some sorta java image API.
i wanna know which API's shud i go thru before starting off, i mean, those concerning jpeg image processing and color vectors.
i know all this sounds too vague, my profound apologies.
18 years ago
though i havent fully understood the problem, i have carried similar sorta text parsing using StringTokenizer, which i f . wonder if it will work out here...
18 years ago
thanx a lot u guys!
i kinda guessed it would have to use some sorta abstract class but was hoping it wud be possible in the existing class structure.
18 years ago
i have an interface which is to be implemented by several classes. all the classes implementing this interface are supposed to be singleton classes, or else they cant implement the interface. i am making the classes singleton by the usual approach of having a static getInstance() method which calls the private constructor if the static member instance of the class is null, else it returns the same instance.
i want to make it mandatory for any class implementing the interface to have this getInstance method. the problem i'm facing is that i can't declare this getInstance method in the interface since it is static. apparently the 'static' modifier is not allowed in interface method declaration.
is there a way to specify singleton pattern implementation in an interface?
18 years ago
thanks again
i am soon gonna dive into the world of JVM
18 years ago
thanx cindy
i almost used the exact same code
one question though, pertaining to the following line in the javadocs:

)]javadocs


If the underlying method is static, the class that declared the method is initialized if it has not already been initialized.


wot does this mean? forgive me if i'm missing some basic funda
18 years ago
is there any way by which i can implement the singleton pattern on a reflected class?
i'm obtaining the class name as a string from a properties file and using Class.forName(String) to instantiate a Class object by that name. is there a way to call a static method implemented in this class (e.g. getInstance(), to implement the singleton pattern )?
rite now i'm using the work-around of calling the newInstance method of Class and then typecasting it to the class name, thus making my static
getInstance method redundant.
18 years ago
cl command not detected on my machine..given in most tutorials..is there an alternative?
i have windows NT
18 years ago