javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Your code is correct with the difference that you need to call the nextLine:

Scanner sc = new scanner (file);
while (sc.hasNext()){
String data = sc.nextLine();

String[] val = data.split(",");
System.out.println(values[0] + " " + values[1]);

}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I have been looking at your code and i don't understand the byte[] calculation(String OrginInput) method. If it is used to "extract" the numbers from the input there are better ways to do it. Also why do you call the negate method inside:

if (count % 2 == 1)
            negate(Number);

When you can simply call the caculator with a minus?
Also calling the calculation method again with recursion isn't very smart.
From what I understand you are trying to convert numbers into byte arrays. I tried simplifying your code. Is this example correct:

String input2 = "56";
        byte[] Number2 = new byte[input2.length()];
        for (int j = 0; j < Number2.length; j++) {
            Number2[j] = (byte) (input2.charAt(j) - 48);
        }

If so then after testing I found that there is a problem when the result is zero. Not when you are trying to add or multiply with zero.

while (s.charAt(index) == '0') {
            index++;
            c++;
        }

At the above code if s is all zeros (s="000") then the expression at the while will always be true. The index will keep increasing and you will get an exception. When you call the charAt you always need to check the length of the String compering it with the index you use. It is like looping an array:
for (int i=0;i<arr.length;i++)

while (index<s.length() && s.charAt(index) == '0') {
            index++;
            c++;
        }
        s = s.substring(c);
        if (s.length()>0 && s.charAt(0) == '-') {
            s = s.replaceAll("-", …
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If I am to call it, what argument should I pass?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Can you post some code? Have you tried debugging your code by adding some System.out.println messages to see what is happenig as the code runs?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

From what I see, you have your code in the readCustomerData method. Every time you call it, new data will come in the ArrayList. Also you don't use the argument of the method. I don't know if this is what you want, but if you want to have the ArrayList private then I would make the following changes.

Remove the method readCustomerData from the class and put it in another class (probably as static)

public class CustomerUtil {

public static CustomerDatabase readCustomerData(String customerNames) 
{
    CustomerDatabase database = null;
    try
    { 

        File f = new File(customerNames);
        Scanner sc = new Scanner(f);
        String logline;
        database = new CustomerDatabase();

        //read header information first
        logline = sc.nextLine();

        while(sc.hasNext()) 
        {
            logline = sc.nextLine();

            //remove this print statement after method works
            System.out.println(logline);

            Customer c = new Customer(logline);
            database.add(c);
        }
        sc.close();
    }
    catch (IOException e) 
    {
        System.out.println("Failed to read the data file: " + customerNames +" with exception: "+e.getMessage());
    }
    return database;
}

}

You can call it like this:

public static void main(String [] args) {
  String fileName = "C:\\Users\\User\\Desktop\\New Folder\\customerNames.txt";
  CustomerDatabase db = CustomerUtil.readCustomerData(fileName);
}

Also, how are you trying to execute your programm? I don't see anything in your main method. If you want to execute anything, you need to put it in the main method and then run that class. It doesn't matter what you have in your class. When you run your class, only what is in the main method executes.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hi let me give you an example about the default constructor. Suppose you have this:

class MyClass {

   public String a = null;
}

You can instantiate it like this:

MyClass cl = new MyClass();

You haven't declared a constructor so it will use the "default". A no-argument constructor.
If you had:

class MyClass {

 public MyClass(String a) {
 }

}

Then the code: MyClass cl = new MyClass(); would not compile. Since you declared a constructor (like in your case) it will use that.

In your case you have a constructor declared in the Customer:
public Customer(String info)
So when you call the c = new Customer() it doesn't compile because such constructor doesn't exist in your Customer class.
In my opinion you don't need one. Just delete the Customer c that you have in the CustomerDatabase. Use what you have in your other post.

Also don't do that: tokens[0].trim() == "female" . For Strings use the equals method:
gender = tokens[0].trim().equals("female")

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Just loop the array or the ArrayList until you find the element that is equals with the input. If you are using Strings use the equals method. If you find it return the index of the for loop. If the loop finishes without finding anything return -1

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hi,
You cannot call a java class if it doesn't have a main method. In the code you posted there is this line:
// public Static Void main (String args[]){} (Static needs to change to static)
When you run a java class: E:\sher\SkyDrive\Exercise Files\L04>java Student
Its main method is called.
Simply uncomment the method main, or create a new class with a main method inside. In the body of the main you will put the code that you want to execute.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Don't use GOTO in jsps. Start a new thread where you explain what you are trying to achieve

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You can filter the results at your query by adding a WHERE. Look for some tutorials on how to write sql statements with WHERE:

select * from emp_details WHERE fname='something'

Then at the jsp page that submits to the ifsServlet you can pass the name or whatever you want as parameter and then pass that as argument to your dao, so you can get the filtered list.

Of course it is assumed that you how to write forms that submit values in jsp.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Thanks

have added the comma as you say now recieve this error:

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 18.

I think I will give this up now and not use the prepared statement it seems to me to be more trouble then it is worth, if I just use an sql statement all works fine so I will just do that, since I will be receiving new and different error messages every time I do change something , my original error was a count field error and I still have not understood why I receive that but thanks to you all

No you should use PreparedStatements. The the error that you get is very simple. Have you tried reading it? Or doing some search on what it means. When you use '?' at the statement you must have as many paramaters at your PreparedStatement. Count how many '?' you have and how many parameters do you set. And then if it still doesn't work repost your latest code.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

As the error message says, you have a syntax error at your query. You must first write your queries in an sql editor, run it with some values and then take it and put it into your code. In your case it seems that you forgot a comma:

"UPDATE empDetail SET [Emp ID]=? [Emp Name]=?,"

At the above part of your query you are missing a comma after the first '?'

It should be:

"UPDATE empDetail SET [Emp ID]=? , [Emp Name]=? , ......." and the rest of your query

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

When you get all the select tags with that method, you can get the name of each one of them and check if it starts with 'participantqty'

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

There is the :
document.getElementsByTagName(tagname)
from:
http://www.w3schools.com/jsref/met_doc_getelementsbytagname.asp

I don't know that mehod, but probably returns all the elements of a specific tag type:
document.getElementsByTagName("select")

You can loop those and check for each one of those their selectedIndex. For the API of the select element refer to the link I provided

Edit:
Also I will ask for your post to be moved to the javascript forum

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Try to add some System.out.println in the readFile method and see what happens. Also you need to declare the list as a private member of the class like filePath. With your way, you create it in the method readFile and then after it executes, you have lost it, you cannot access it

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Create a method in a class that executes the select query and retrieves the data. Save those data in an ArrayList.

In your jsp call that method and with a combination of html and java (scriplet) populate the drop down box

JSP:

<%
ArrayList list = yourClass.getData();
int size = list.size();
%>

<select name="someName">
<%
for (int i=0;i<size;i++) {
  String s = (String)list.get(i);
%>
<option value="<%=s%>" ><%=s%></option>
<%
}
%>
</select>

If the above code is confusing or doesn't make sense then you should do more studying about JSPs and html

Also you should already know how to run queries or use java core methods before going to JSP.
For your method that runs the query, better create a class that has a combination of 2 attributes (value, text). The ArrayList should have elements not Strings but of the class you created. When you run the query you would need a value to display and a value to use at the <option> :

JSP:

<%
ArrayList list = yourClass.getData();
int size = list.size();
%>

<select name="someName">
<%
for (int i=0;i<size;i++) {
  YourClass obj = (YourClass)list.get(i);
%>
<option value="<%=obj.getValue()%>" ><%=obj.getText()%></option>
<%
}
%>
</select>

You should know how to create your own classes and how to use them (get/set methods)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Check if the connection is created to the database

Connection con;
Statement stmt=con.createStatement();
ResultSet rs=null;

String ss=("SELECT VIDEOID, VIDEONAME, DIRECTOR FROM VIDEOS");
rs=stmt.executeQuery(ss); 
while(rs.next())
{
//code goes here
}

That is not what TIM_M_91 has asked.


@TIM_M_91:
It is odd that you haven't found the correct syntax because all you needed is some basic tutorials about sql: http://w3schools.com/sql/default.asp
Any way, you can add this to your query:

SELECT VIDEOID, VIDEONAME, DIRECTOR 
FROM VIDEOS
WHERE VIDEOID=[I]something[/I] AND VIDEONAME=[I]somethingelse[/I] ...

Instead of AND you can use OR

The columns that you use as filters don't need to be at the select. This query is valid for example:

SELECT VIDEONAME
FROM VIDEOS
WHERE VIDEOID=[I]something[/I]

If you want to put it in java, using the Statement interface (as in your code) you can try this:

String videoId = "some_value";

String ss="SELECT VIDEOID, VIDEONAME, DIRECTOR FROM VIDEOS";
ss += " WHERE VIDEOID='"+videoId+"'";

System.out.println("Executing query:"+ss);

rs=stmt.executeQuery(ss);

What's out for the single quotes ' . The value of the ss is the query executed so print it and see what you have.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

attendance management system project in java or jsp please upload its urgent

Upload what? The code? If you want the code no one is going to do it for you. Where did you get the impression that we make others people homework.

If you want help, start by reading the tutorial you can find in a link posted in this thread. Then start a new thread with any questions that you might have.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

i've got the answer, i hope it would be useful :)


Set the varaible into the session in Page1.jsp and access the same in Page2.jsp.
In Page1.jsp
session.setAttribute("X", "value");

In Page2.jsp
String x = session.getAttribute("X");

Unfortunately that is the wrong way to pass the value. You should never use session to pass values from one jsp to the other.
If you are using window.open, can you post that part of your code so I can suggest a better way.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

you can catch array index out of bound exception.

Never use try-catch for ArrayIndexOutOfBoundsException. You already know at runtime the size or length of what you are trying to use. So always check that.

long89:
So when looping, it is good to do this instead of what you have:

for (int i=0;i<people.length;i++) {
 // use people[i]
}
stultuske commented: agreed. avoiding an indexoutofboundsexception is way better than handling it. +14
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You can load the servlet directly. Instead of writing at the url:
http://localhost:port/index.jsp

you can write:
http://localhost:port/YourServlet

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Where did you find this: "jdbc:derby:comstar;create=true" ?
I did some search and found an example that used this:
jdbc:derby://localhost:<port>/<your db>

Also since yoou don't provide username password then why don't you use this:
con = DriverManager.getConnection(host)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I split the connections and discovered I hadn't even declared stm2 as a prepared statement, rather a redular statement! This fixed the error, I have to agree with you about the amount of code on my JSPs, I'll look at changing the logic to servlets, though my lecturer insisted on everything handled in JSP...Thanks for the insight guys.

Usually when a teacher tells you to do something that is not the right way, is because they want to keep things simple and not to confuse you by teaching you things you won't understand. Maybe because the right practice could be too advance.

But this is NOT the case here. When your teacher said put everything in the JSP is like saying put everything in the main method.

Imagine having a class with a method inside:

class EmployeeDao {

   public int insert(...arguments...) throws Exception {
     // create connection
     // execute insert query
     updateQuery = stmt2.executeUpdate()
     // close connection
    
     return updateQuery;
   }
}

Then you can do this:

EmployeeDao empDao = new EmployeeDao();
int i = empDao.insert(arguments);
// handle i value

You can call the above 2 lines anywhere you want. In a jsp, in a servlet, in a main method, in a swing application.

Imagine putting the entire code of the insert method in a jsp, and then having to write if-else statements.

Now with this approach you can do this for example in a jsp or better servlet.

EmployeeDao empDao = new EmployeeDao();

String action = …
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The constructor conTest already calls the doConnect so you don't need this: stud.doConnect()
It is like calling twice.

Also you need to close the connection and statement. First the resultset then the statement and last the connection.

Also try to print the stack trace:

catch(SQLException err){
  System.out.print(err.getMessage());
  err.printStackTrace();
}

Does the System.out.println("Driver is missing") gets printed?
Does the table has data?

Post the stack trace that you get

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The Class.forName needs to be in a try - catch. If you have it correctly and put the driver to the classpath, it will never give you an exception. Which is a good way to see if you have actually set the classpath correctly:

try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch (Exception e) {
System.out.println("Driver is missing");
}

Try to execute a small piece of code in a main method, just to test the connection.
What you have for example with printlns

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Does the Student table actually exists? Have you trying running the query to an sql client? Do you need to set the username, password. Is the host correct? What driver are you using? Have you set that driver to the classpath?
Try to find examples on how to connect to the derby.
And when I use sql, I also write:

Class.forName("the driver's full package");

Also you need to close the connection, statement, resultset after you are done. Don't have as global variables. Declare them in the method, outside of the try:

public void doConnect() {
Connection con = null;
    Statement cmd = null;
    ResultSet rs = null;

    try {

    catch (Exception e) {

    } finally {
    // code for closing them
       try { if (rs!=null) rs.close(); } catch (Exception x) {}
       // same for statement
       // same for connection
    }
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Thank you all for your feedback

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you want to put them all in one jsp then you will need a lot of ifs. And you will end up with this:

if (id==1) {
 // some html code
} else if (id==2) {
  // some other code
}

And you will end up having a lot of different pages in one file. But you said yourself that you don't want to do that so it's up to you.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hello everybody, My question is simple.

I wish to develop a web site and I have been looking for web hosts and most offer MySql. At my job we use oracle, but after some searching I haven't found any great differences between them and any real reasons why I should choose one over the other.

So I would like to ask, from your personal experience, if MySql is the right choice and good enough for handling large numbers of data or paying some extra money for choosing oracle is worth it.


I know that beeing in the MySql forums most people would recommend MySql, but let's be objective :)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The inputs with type="file" work differently. You may be able to take the request.getParameter("importExtruderFile") but you cannot use that path to create a file and read it. I don't remember it exactly but if you search the net you will find what methods to use.

Take a look at this example that I found in a rush:
http://www.developershome.com/wap/wapUpload/wap_upload.asp?page=jsp3

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It is not a function and on its own it means nothing.

The only thing similar to this, is when I set the data option when making an ajax call with jQuery.

http://malsup.com/jquery/form/

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You don't have to put all those ifs in the index jsp because what you are trying to do should be divided into 2 jsps.

Assuming that your first jsp is called: login.jsp. There you don't have to check if the user is logged in. All you have to do is have the login form. You can also have a message displayed if it is not null:

String message = (String)request.getAttribute("message");

if message is not null display it

- login form - with input fields and a submit button

Then submit to your login Servlet. If the user name is not correct, fill the appropriate message:

request.setAttribute("message", "Invalid username, password");

and redirect back to the login.jsp

If the username password are correct then redirect to the main page of your application (welcome page).
In there you will get the username from the session and check if it is null.

So you will not have many ifs in one page. One page for the login. One servlet for validation. Then depending on the results, go back to the login page or go to your main page

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It depends on where you put your image and how you deployed your web application and what server do you use. If you simply used NetBeans to create the .war file or just run your application then the image is not beeing read from where you think it is. In the above case your image is deployed inside the war and you must read from there.

I have tried your example and had the same problem. Then I moved the image inside a folder in the structure of the server and it worked. In my case I had the .war in :
.......\domains\testDomain\autodeploy\web_app.war and I moved the images at:
.......\domains\testDomain\autodeploy\images
And at the code I used: src="/images/image.jpg"

The first thing you can do is try to read the images from the .war file or from whatever you have deployed. Or:

You need to open the directory where your server is running and place the images in a folder where your application is. From your images it looks to me that you are using NetBeans. If you go to the Services tab, (next to the tabs where you see the structure of the project - the image you posted) click the Servers icon and follow the tree. Right click on the server you are running and find its location. There you will find your application and place there your folder with the images.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You also need to post the exception that you get. Did you put in the classpath the my-sql-connector.jar ?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I am sorry to tell you this, but if you are a beginer with java why do you write jsps? The code that you wrote has several errors, but not because of your lack of effort. Because there some things that you have confused and you need some studying to do first before start writing. The code will not work the way you "imagine" that it will work. You write html and javascript and assume that it will behave like java does:

<INPUT NAME="GIRL">
That is not how you declare variables in html and you cannot reference it like this:
document.write ("Take "GIRL" to the "PLACE" on "DAY);
because there aren't any variables in html that you can call at "runtime"

The function PickDate is written in javascript and you are trying to call java methods in it.

You are trying to write html as if you are writing java in a main method.

From your code one can understands that you have confused a lot of things about the differences between java - html - jsp - javascript and it will not help you learn if someone just writes it for you.

As hiddepolen stated - while I was preparing this post - what you are trying to do can be done with pure javascript. You need to declare the html tags correctly and use the apropriate javascript in the PickDate. You are also trying to use java in the html …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

please can you help me ? I need to declare an array to input 10 quiz scores compute and print the average and the lowest quiz score ..

Start a new thread. What have you done so far? Declaring an array is simple. Just go through your notes.
Then you need to loop the array in order to do the calculations that you need. I am sure that your teacher has given sone clues on how to solve this

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Have you tried installing eclipse? Java is not an application. What I did was download java, install it, and installed an IDE (eclipse in your case) of my choice.
When I run the IDE it asked me to enter the location of the java that I installed.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Actually i have written a small program on division, now i want see the control flow means how the line of code is executing and calling the methods and function step by step.

But when am run the program in debug mode nothing is showing

You must first place a breakpoint. You place somewhere in your code and when you debug, the code runs up until that point and stops. You can then see all the values of the variables that have been initialized up to that point. Then you have some options where you can continue line by line and observe the code and the values.

To place a breakpoint in eclipse simply right click at the left side of the editor where the line numbers are.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all remove all of the database code and put it in seperate methods and classes and call those methods from the jsp.

Then read the exception that you get. It tells you exactly what the error is at line 66
The NumberFormatException is thrown when you cannot convert something to a number:
Integer.parseInt(codigo)
And the stacktrace says: java.lang.NumberFormatException: null

You are trying to write some complex code with out knowing the basics. Handling NumberFormatException and figuring out that you are trying to parse something which is null is very simple. Especially since the exception tells you exactly that. I would like to suggest that you to take one step back.

Forget about jsps and jasper. Try to write simpler codes first and make a lot of mistakes. Seriously that is how you learn to read the stack trace and correct the errors that you get. By making them.

And by trying to execute queries in jsp is an indication that you haven't written many java core programs. Did you always put all of your code in the main method? Or did you have different classes with methods and call those methods in the main. You must do the same here. NO java code in the jsp unless they are used to displying the data or retrieve them and pass them as arguments to methods that do all the work

onosan commented: 0 +0
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Is the url correct: jdbc:mysql://localhost/test ? Maybe you are missing the port:
jdbc:mysql://localhost:<port>/test

As the exception says:
Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?

Try to read first the exceptions that you get. They provide the solution.

Also you have another error in your logic.
You don't need to call the commit method because the connection is set to auto commit by default.
You don't need to call commit in general when you call 'create' statements. Only for insert - update
You close the connection and then you call the commit. The close needs to be the last command. How can you commit anything if you have already closed the connection.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

error is:
Exception in thread "main" java.lang.NullPointerException
at FirstExample.main(FirstExample.java:35)

Inside the main method of the FirstExample.java file at line 35 you are using something which is null. Do you get any other errors?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You don't only get a NullPointerException. You also get a stack trace. Have you tried reading it? It tells you where the error is and what is the problem. You can try posting it, since it is unlikely someone will read AND compile your entire code in order to find the error.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

but he suggesting me to use class/get/set methods... but i don't want use that one because am a beginner so i want to learn step by step. so, I really appreciate him thanks a lot

Thanks,
Abrar

Actually those are the first things you learn. If you don't know how to create your own classes with attributes and get/set methods, stop immediately trying to write sql and jsp.
You cannot proceed with anything if you don't know that because it is basic O.O. programming.

Later on you will not be able to write anything that concerns connecting to a database and displaying the results if you can't put the results in objects that you created.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Can you post some more code? Also you can look at the:
http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all check your query. Always print it before you run it and see what is going on. In this case you have this: "select *from student where no=' " +num+" ' "; Can you see the blank spaces where you have the quotes. Also you need a space at the '*'. This is what you execute:
select *from student where no=' 1 '

You need this:
select * from student where no='1' "select * from student where no='" +num+"' "; Or since 'no' is a number you can leave it like this:
select * from student where no=1 : "select * from student where no="+num; And before you continue, delete all that code from your jsp. Put all tha code in a method in a seperate class and call that method:

<%@ page import="java.sql.*" %>
    <html>
    <BODY style="background-color:SteelBlue">
	<form>

<table border="1">
<tr><th>No</th><th>Name</th><th>qual</th></tr>
<%
int num=Integer.parseInt(request.getParameter("no")); // no is student id taken from 
	
/*
Call a method with argument the num that returns the student. Crerate a Student class with attributes the columns of the table with get/set methods
*/
Student st = yourClassInstance.getStudentByNum(num);
    

<table  cellpadding="15" border="1" style="background-color: #ffffcc;">
<tr><td>No:</td><td>Name:</td><td>Qualification:</td></tr> 

<% 
// if no student found (rs.next==false then return null) an example at the end
if (st!=null)
	 { 

    %>
	    <tr><td><input type="text" name="no" value="<%=st.getNo()%>" ></td>
        <td><input type="text" name="no" value="<%=st.getName()%>" ></td>
        <td><input type="text" name="no" value="<%=st.getQual%>"></td></tr> 
<%
}%> 
<br>

    </table>
	</form>
<form action="view.html" method="get" ><input type="submit" value="Go Home"/></form>
</body>
</html>

Also at the search.jsp you have the input …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hey JavaAddict,

Can you detail more about how to use the hashtable? Or is there another way to make customers have one account but more transactions?
I created the 2 classes that inherit from Customer , but i don't know how to link the unique ID with the unique account.

Thanks for the help.

That would depend entirely on the your specific requirements, that may be different than the ones of the OP.
Usually the transaction is linked with the account, so many transactions can happen to a single account. For that case you can have a Transaction class with one of its attributes to be the accountId or the Account class.

As for the customer part, you need to make a new thread, specifying your requirements and what you have done so far

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Doesn't seems to be possible with select & options. One of the way I seen suggested was with div and JavaScript

Seems like it. After some search there doesn't seem to be a way to do it with conventional html or javascript.
Thanks for the reply.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hello everybody. I have a question/problem.
I have a select tag with several options. Sometimes the text of the option becomes very large. So I tried something like this for example:

<select>
  <option>A Very Big <br/> sentence</option>
</select>

But it didn't work. What I was trying is to put the <br> between the option tags, so some of the options to be displayed in 2 lines.

Is that possible?

Thank you.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You need to post your code and see what happened

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You will need pure javascript, not java.
Have a button. when the button clicks, execute a function that takes the value of the text field.
If the values is "username" make it empty: (value="")

Check out the tutorials form the W3Schools site about javascript