Anna Jean

Greenhorn
+ Follow
since Dec 23, 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 Anna Jean

Saritha,

Make sure you run the batch file in the same directory as the db2java.zip file. It should be under SQLLIB/java12 I believe. The batch file is called usejdbc<X>.
Michael and Jeanne,
Thank you for your responses. Jeanne, You were right, my problem was with the scope. I will try to find another way around declaring it within the if statement. Unfortunately, all the other fields are bases on which entity is initialized.Both entities have similiar fields for example:
anEntity.getTime()
anEntity.getLocation()
My entities are declared (within the if statement) as Entity1 anEntity and Entity2 anEntity, so either way, anEntity would work.Can you think of another was to initialize the entity, keeping in mind that the entity should be initialized based on the radio button selected in the jsp.
Any assistance is greatly appreciated.
Thanks,
Anna
20 years ago
Hello everyone and Happy New Year!
I am running a test servlet that is reading a radio button field within a jsp to determine what radio button was selected. Based on that, it will create a new entity object. For example, in the jsp:
<CODE>
<INPUT TYPE="Radio" NAME="car" VALUE="1" >
<INPUT TYPE="Radio" NAME="car" VALUE="2" >
</CODE>
From the Servlet:
<CODE>
if (req.getParameter("car") == "1")
{
Entity1 anEntity = new Entity1();
}else if (req.getParameter("car") == "2"){
Entity2 anEntity = new Entity2();
}
</CODE>
The problem is that based on the code above the other fields in my servlet that are using "anEntity" are getting a compilation error that "myEntity cannot be resolved" as though they are not being initialized. For example:
<CODE>
String userId = req.getParameter("UserId") ;
anEntity.setUserId(userId);
</CODE>
Can anyone help me understand why this code is not valid?
Thanks,
Anna
20 years ago
Hi Joel,
It all makes much more sense now. In fact, the way you explained it, it seems so simple I am wondering why I could not fiure it out. Anyway, I truly appreciate your time and great explanation. It has helped significantly. I will also be sure to use the [code] tags on future posts.
Thank you.
20 years ago
Hello,
I am trying to determin if the numeric numbers in a string are incremental. I have written the following code(and this is assuming that s is not null and is numeric), but there is something that is still not working. Any feedback or suggestions on a better way to accomplish this would be greatly appreciated.
public boolean validateIncrementalNum(String s){
int iNumCount = 0;
for(int i = 0; i<s.length(); ++i) {
if(s.charAt(i) == s.charAt(+i))
{
iNumCount++;
}else {
break;
}
} //end for loop
if (iNumCount == s.length())
{
return false;
}
}
20 years ago
Thanks Dmitry!
I really appreciate your help.
20 years ago
Hello,
Thank you for responding to my post. The string will contain numeric numbers. For example (88888). I want to validation that will determine if all numbers in the string are the same. Does this make sense?
20 years ago
Hello,
I am new to Java and wanted to get your thoughts on the best way to validate that all numbers in a string are not the same.
Any assistance would be greatly appreciated.
20 years ago