Hi whats wrong with my loop?
hiya what is wrong with my loop?
here is the code...
StringTokenizer token = new StringTokenizer(searchCriteria,"AND");
while(token.hasMoreTokens()) {
v.addElement(token.nextToken());
j++;
String query = "SELECT * FROM Login_Details LD, Personal_Details PD, Education E, Work_Experience WE, Skills S WHERE LD.Email_Address = PD.Email_Address AND LD.Email_Address = E.Email_Address AND LD.Email_Address = WE.Email_Address AND LD.Email_Address = S.Email_Address";
ResultSet rs = st.executeQuery(query);
Enumeration enum = v.elements();
while(enum.hasMoreElements()) {
if(rs.next()) {
if (((String) enum.nextElement()).compareTo(rs.getString("Forename"))==0) {
out.println("yeh " + v.size());
else {
out.println("nah" + v.size());
else {
%>
<DIV ALIGN = "center">
<H1><% out.println("Sorry no results found!"); %></H1>
</DIV>
<%
st.close();
con.close();
basically whats happening is that the StringTokenizer tokenizes the Stirng 'searchCriteria' and puts all the tokens in a vector
then the SQL statement retrieves all the information from all the tables in the database and saves this in a ResultSet.
the ResultSet needs to be then looked through and each 'Forename' column obtained from the ResultSet needs to be checked against each element in the vector...
at the moment only the FIRST entry in the database is being found and all the others are not
thanks :o)
try this
<%
StringTokenizer token = new StringTokenizer(searchCriteria,"AND");
while(token.hasMoreTokens()) {
v.addElement(token.nextToken());
j++;
String query = "SELECT Forename FROM Login_Details LD, Personal_Details PD, Education E, Work_Experience WE, Skills S WHERE LD.Email_Address = PD.Email_Address AND LD.Email_Address = E.Email_Address AND LD.Email_Address = WE.Email_Address AND LD.Email_Address = S.Email_Address";
ResultSet rs = st.executeQuery(query);
while(rs.next()) {
Enumeration enum = v.elements();
while(enum.hasMoreElements()) {
if (((String) enum.nextElement()).compareTo(rs.getString("Forename"))==0) {
out.println("yeh " + v.size());
else {
out.println("nah" + v.size());
st.close();
con.close();
%>
Mars Amutha
Similar Messages
-
1 Declare
2 v_system_user VARCHAR2(30);
3 v_system_user_flag number :=0 ;
4 v_username varchar2(30);
5 Cursor C_system_users is select * from dbaoper.t_system_users;
6 begin
7 for v_system_user in C_system_users loop
8 dbms_output.put_line('v_system_user');
9 if v_username = v_system_user
10 then
11 v_system_user_flag := 1 ;
12 end if;
13 end loop;
14* end;
SQL> /
if v_username = v_system_user
ERROR at line 9:
ORA-06550: line 9, column 16:
PLS-00306: wrong number or types of arguments in call to '='
ORA-06550: line 9, column 2:
PL/SQL: Statement ignored
Thanks,
PramodHi,
No idea what you're trying to do here.
You're confusing a record variable (you don't need to declare that using a FOR loop) with a single variable.
Assuming your table has a column called 'username' try some thing like:
Declare
-- v_system_user VARCHAR2(30);
v_system_user_flag number :=0 ;
v_username varchar2(30) := 'SOME_USERNAME' ; --<< you need to apply a value to v_username
Cursor C_system_users
is
select *
from dbaoper.t_system_users;
begin
for rec in C_system_users
loop
dbms_output.put_line(rec.username);
if v_username = rec.username
then
v_system_user_flag := 1;
end if;
end loop;
end;Edited by: hoek on Jul 8, 2009 5:37 PM typo's -
What is wrong with the loop?
What is wrong with the loop? I am trying to make the loop with start to end dates. What is wrong with those codes that
I made:
Calendar startLoop = new GregorianCalendar(2003, Calendar.SEPTEMBER, 01);
Date datessss = startLoop.getTime();
Calendar endLoop = new GregorianCalendar(2003, Calendar.SEPTEMBER, 05);
Date datesssss = endLoop.getTime();
int result = 0;
while (endLoop.after(startLoop){
startLoop.add(Calendar.DATE, 1);
Date dates5 = startLoop.getTime();
System.out.println("New Date: " + dates5);
}Because I got an error those:
while (endLoop.after(startLoop)Anybody know what is wrong with it?In general you'll get better help if you paste in the exact, complete error message.
In this case it's easy. Count your parentheses. -
When I try to power up my iphone 4 32g, it will stay on the apple screen for a few seconds then turn off. even when I try connecting it to my computer it turns on for a few seconds then turns off. Whats wrong with it? and what do I do about it?
Have you tried charging it with another known working USB sync cable? After letting it sit to "charge" for at least 30 minutes, have you tried resetting the device by pressing and holding both the Select/Center and Menu buttons together long enough for the Apple logo to appear.
B-rock -
My phone has been asked to be plugged into itunes for the past hour or so, and it has been plugged in the whole time... i have tried holding in both buttons too turn it on and nothing is happening... whats wrong with it and how do i fix this :(?
Does iTunes see your phone?
Do you have a PC or a Mac?
~Lyssa -
when i open itunes, it gives me a message "the folder itunes is on a locked disk or you do not have write permissions for this folder" i am the only user and it was working a week ago whats wrong with it? it will not open itunes
Hi lvdmerwe!
I have two articles here for you that should be able to help you troubleshoot this issue further:
Trouble adding music to iTunes library or importing audio CD
http://support.apple.com/kb/ts1387
iTunes: Missing folder or incorrect permissions may prevent authorization
http://support.apple.com/kb/ts1277
Take care, and thanks for visiting the Apple Support Communities.
-Braden -
i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help
The users guide says:
Spotlight searches the following:
Contacts—All content
Apps—Titles
Music—Names of songs, artists, and albums, and the titles of podcasts and videos
Podcasts—Titles
Videos—Titles
Audiobooks—Titles
Notes—Text of notes
Calendar (Events)—Event titles, invitees, locations, and notes
Mail—To, From, and Subject fields of all accounts (the text of messages isn’t searched)
Reminders—Titles
Messages—Names and text of messages
Try:
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Unsynce all music and resync
- Reset all settings
Go to Settings > General > Reset and tap Reset All Settings.
All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
- Restore from backup
- Restore to factory settings/new iOS device.
- Make an appointment at the Genius Bar of an Apple store.
Apple Retail Store - Genius Bar -
HELP PLEASE - WHATS WRONG WITH THIS CODE
Hi. I get this message coming up when I try to compile the code,
run:
java.lang.NullPointerException
at sumcalculator.SumNumbers.<init>(SumNumbers.java:34)
at sumcalculator.SumNumbers.main(SumNumbers.java:93)
Exception in thread "main"
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
I am not sure whats wrong with the code. Any assistance would be nice. The code is below.
package sumcalculator;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class SumNumbers extends JFrame implements FocusListener {
JTextField value1;
JTextField value2;
JLabel equals;
JTextField sum;
JButton add;
JButton minus;
JButton divide;
JButton multiply;
JLabel operation;
public SumNumbers() {
SumNumbersLayout customLayout = new SumNumbersLayout();
getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);
value1.addFocusListener(this);
value2.addFocusListener(this);
sum.setEditable(true);
value1 = new JTextField("");
getContentPane().add(value1);
value2 = new JTextField("");
getContentPane().add(value2);
equals = new JLabel("label_1");
getContentPane().add(equals);
sum = new JTextField("");
getContentPane().add(sum);
add = new JButton("+");
getContentPane().add(add);
minus = new JButton("-");
getContentPane().add(minus);
divide = new JButton("/");
getContentPane().add(divide);
multiply = new JButton("*");
getContentPane().add(multiply);
operation = new JLabel();
getContentPane().add(operation);
setSize(getPreferredSize());
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public void focusGained(FocusEvent event){
try {
float total = Float.parseFloat(value1.getText()) +
Float.parseFloat(value2.getText());
sum.setText("" + total);
} catch (NumberFormatException nfe) {
value1.setText("0");
value2.setText("0");
sum.setText("0");
public void focusLost(FocusEvent event){
focusGained(event);
public static void main(String args[]) {
SumNumbers window = new SumNumbers();
window.setTitle("SumNumbers");
window.pack();
window.show();
class SumNumbersLayout implements LayoutManager {
public SumNumbersLayout() {
public void addLayoutComponent(String name, Component comp) {
public void removeLayoutComponent(Component comp) {
public Dimension preferredLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
Insets insets = parent.getInsets();
dim.width = 711 + insets.left + insets.right;
dim.height = 240 + insets.top + insets.bottom;
return dim;
public Dimension minimumLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
return dim;
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
Component c;
c = parent.getComponent(0);
if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+48,128,40);}
c = parent.getComponent(1);
if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+48,128,40);}
c = parent.getComponent(2);
if (c.isVisible()) {c.setBounds(insets.left+408,insets.top+48,56,40);}
c = parent.getComponent(3);
if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+48,152,40);}
c = parent.getComponent(4);
if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+136,72,40);}
c = parent.getComponent(5);
if (c.isVisible()) {c.setBounds(insets.left+248,insets.top+136,72,40);}
c = parent.getComponent(6);
if (c.isVisible()) {c.setBounds(insets.left+368,insets.top+136,72,40);}
c = parent.getComponent(7);
if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+136,72,40);}
c = parent.getComponent(8);
if (c.isVisible()) {c.setBounds(insets.left+176,insets.top+48,56,40);}
}Thank you. How do i amend this? I have defined value1though.Yes, you did - but after the call to addFocusListener(...). It needs to be before it.
BTW, you did the same thing with "value2.addFocusListener(this)" and "sum.setEditable(true)" on the next two lines. You're attempting to call a method on an object that doesn't exist yet (i.e., you haven't called new yet). -
I have the Iphone 3gs and it said update required and i needed to connect to itunes so i did al that and now everytime i go to restore everything it just says error and then i have to do it again?whats wrong with it?
Are you getting an error message number with your error message? If so, what number are you getting?
-
My lap top is extremly slow. It studders. It kind of sounds like there is a fan inside and it constantly stopping and starting. And, it takes a really long time for it too start up. Whats wrong with it?
Do you have current backups?
Those symptoms could indicate a failing Hard drive. If it dies, all your documents go with it unless you have Backups.
I have had very good luck with physical and battery problem diagnosis at the Genius Bar. Those guys put their hands (and their ears) to these machines, all day every day, and they know immediately what all those sounds mean.
Your appointment for an evaluation is FREE, in warranty or out. -
after updating 4.3.1 to 4.3.3 my i phone 4's wifi is not working 2 to 3 hrs of it ,but 3 hrs i was downloding free soft 4m itunes.............so what wrong with my phone
Thanks for reply,
It's truely a disestar for me to kill my phone myself by so called bloody upgradation.
Iwish I have not upgraded.
I baught it from here in Bangladesh and now I’m ina mess to get at least a minimum support.
Thanks for your valued suggessions but it didn’tmade any difference to my situation.
So now I have an ipod in the price of an iPhone4. Crap.
Is there any chance of fixing this bug by apple?As the same problem has already been faced by a lot of iPhone Users. -
I just got a ipod nano 6th gen, and ive been using it for 2 days, and it seems that the battery just lasts about half a day, on playing 1 to 3 songs in intervals of 1-2 hours. Whats wrong with my ipod?
Your nano would really have nothing to do with it at that point. It is really something between iTunes and whatever server out there on the internet that it is trying to connect to for the update.
Try posting this one in the iTunes forum, they might have a solution for you.
i -
Whats wrong with the servers i cant download update 5.1 firmware
whats wrong with the servers i cant download update 5.1 firmware ive been trying for 2 days it says i dont have permission to access the requested source
What says you don't have permission to access the requested source? That is not an error that should come up at all either from iTunes or when attempting an over the air upgrade. At least not an error that has anything to do with the servers.
It could be a permissions problem on your computer or an issue being caused by your firewall or antivirus software. -
I have been trying to open itunes that has already been installed. But, the thing is it never opens and when i do right click and trouble shoot also, it doesnt open. I dont whats wrong with itunes and my comp is 64 bit windows 7. Can somebody please help
no its 64 bit version of itunes. Can you please help me. I am not able to sync my iphone.
-
What wrong with the buttery ?
hallow
my question about the buttery i don't know what wrong with it . the buttery get finish after one and half hour using .
please help me
my Email
[email protected]
my mobile
+966554302679Hi kamranh,
I'd try starting Firefox in [[Safe Mode]]. If you don't have the issue while all of your add-ons, extensions, and themes are disabled, you can try adding them back in one by one until you find the culprit. You should look at the [https://support.mozilla.org/en-US/kb/Troubleshooting-extensions-themes Extensions and Themes troubleshooting guide ] and the [[Troubleshooting plugins]] article as well.
From the looks of it though, your issue may be because you've been hit with some [https://support.mozilla.org/en-US/kb/Is%20my%20Firefox%20problem%20a%20result%20of%20malware?s=malware&r=0&e=sph&as=s#w_how-do-i-get-rid-of-malware Malware].
If isn't malware or a plugin issue, you should take a look at the Knowledge Base article [[Search bar]]. Your default search might have been changed by a particular site. Sites like MSN, Yahoo, etc have been know to ask to become your homepage and change your search engine.
If the address bar search has been changed as well, you might want to take a look at [[Location bar search]].
If that doesn't work you should look at the article [[Preferences are not saved]].
Hopefully this helps!
Maybe you are looking for
-
My daughter down loaded the new 6.0 software and now her home button does not work. Tried reseting to original settings and reset the operating software. Any ideas?
-
Transforming XML into nested Internal Table via Call Transformation XSLT
Hi guys! I am relatively new to this XML transformation to Abap Internal table. Hence I got help some help from this thread ABAP Development as well as referencing Txn SSTDEMO1 and SSTDEMO2 But I tried to attempt on my prog it failed. Heres my sample
-
How to uninstall/install again BEA Workshop for JSP
Hi there, I've recently changed my Eclipse version and its installation folder. After this operation, the BEA Workshop plugin was no more visible, so I decided to uninstall and install again the entire plugin. Unfortunately, when the uninstall operat
-
Enhancement of File Adapter Functionality.
We are trying to do some complex functionality and the file adapter doesnot support the functionality.Are there any guides/docs/SAP NOTES which helps us to enhance the standard file adapter functionality.
-
My phone is 1 month old and developed this problem recently. The maps do not display when I open the Nav function and neither do the Contacts. When I press the Exit button in the Nav function, it displays Null_strings? which takes me back to the orig