1,963 Posted Topics

Member Avatar for rotten69

From the screenshot, I assume that you took all the files form somewhere else and put them in eclipse? If that is the case, then I see that you took the .java files and the .class files and put them in same folder src/ I think, without knowing your settings, …

Member Avatar for rotten69
0
10K
Member Avatar for Neo_cse

You can do it with ajax, and you will also need to learn javascript. It is easier to use the jQuery library to make an ajax call.

Member Avatar for javaAddict
0
99
Member Avatar for reemhatim

Where are the images located? Are they at same folder as the ButtonFrame class file is?

Member Avatar for reemhatim
0
159
Member Avatar for jpleas

Don't put everything in the main method and don't write everything at once. First create a Student class with attributes: name, hours, grade. Then have a single method: In that method read the file with the students and have the method return a list with the data. The List will …

Member Avatar for javaAddict
0
498
Member Avatar for yatin.baraiya
Member Avatar for Brillig
-1
124
Member Avatar for ravi_91

Can you post the method and only the method that you use to read the rows from the database?

Member Avatar for ravi_91
0
132
Member Avatar for caierhui

[QUOTE=JamesCherrill;1602275]a user told me "x will never happen" and then it did, after I shipped the code[/QUOTE] Same here.

Member Avatar for javaAddict
0
316
Member Avatar for mynameissiva

Run the query (SELECT * FROM log) from a different method. Create a custom object, run the query, put the results inside the object and have that method return a list with the data. Call that method form the servlet. The servlet will have only that call. Once you get …

Member Avatar for mynameissiva
0
254
Member Avatar for sunjcarkey

[QUOTE=rufframa;1207605]I'm having the same problem. i have printed the SQL string and the syntax seems correct to me. Could the problem be located outside of Java maybe in the database driver?[/QUOTE] A new thread by you, with your code and the error merssage, would be helpful

Member Avatar for Ezzaral
0
380
Member Avatar for andreson

You don't need the commit command. It is done automatically, unless specified otherwise. Also try to print the query and what actually gets executed. Also the executeUpdate returns an int value. It shows how many rows have been updated/inserted. Try to print that too. Also your catch block is empty. …

Member Avatar for andreson
0
202
Member Avatar for jyotishankar

You don't need the selectCheckBox1,2,3. When the check box is clicked, it is checked automatically. Also there is no problem in having the name and id attributes having the same value. In some cases you need them to have different values but they can also have the same. Also what …

Member Avatar for javaAddict
0
134
Member Avatar for Majestics

Are you sure that this is exactly what the message has inside? "ORA-00001: unique constraint (WAJAHAT.INVOICE_UQ) violated" Try first to print the message like this for exmple: [CODE] System.out.println(">>"+e1.getMessage()+"<<"); [/CODE] Then you will know exactly what the message prints. An easier solution would also be: [CODE] if ( e1.getMessage().indexOf("WAJAHAT.INVOICE_UQ")!=-1 ) …

Member Avatar for mKorbel
0
116
Member Avatar for t@sos

The API is there for you to read it, not learn it by heart. As long you know how to call methods with the right number and type of arguments and put the return value inside the right type, you are ok. Of course that doesn't mean that for every …

Member Avatar for gyno
0
2K
Member Avatar for abhisheyke

You can set all the attributes back to null yourself: [CODE] session.setAttribute("username", null); [/CODE] But I am sure that you have already thought of that. As far the invalidate method you can try and check the API.

Member Avatar for javaAddict
0
54
Member Avatar for jamd200

If I may add, I don't believe that the approach of using a try-catch for handling the length of the arguments is correct: [CODE] catch(Exception e) { System.out.println("There can only be four arguments entered for this program."); System.out.println("At the next prompt in this command line,"); System.out.println("enter 'java Test' followed by …

Member Avatar for jamd200
0
2K
Member Avatar for Majestics

I don't know if it is helpful but in case you don't know: Have you tried the to_date and to_char methods? They are sql oracle functions for converting dates to strings like the SimpleDateFormat in java. If the column is of type DATE, then it will store date, no matter …

Member Avatar for debasisdas
0
162
Member Avatar for nisrin

[QUOTE=ssaatt;1590975]i need jsp and servlet coding for login page where the username and password must b stored in a db table[/QUOTE] And I want vacation. Sorry I thought that this thread was for posting what we want but [U]you won't get[/U]! Seriously: This thread is very old. If you have …

Member Avatar for javaAddict
0
1K
Member Avatar for thomas6188

I don't believe that you need to put login.java. When you create a servlet it is defined in an xml file where the name of the servlet is set as well as the java class file. So there is a mapping between the servlet name and the class file. Netbeans …

Member Avatar for dresses623
0
155
Member Avatar for stevanity

I tested your code and couldn't get it to work. The buttons weren't displayed. I would advise you not to use the paintComponent. It it used to paint graphics (circles, images, lines, ....) You don't need that method to add buttons and other components such as JLabels Try putting the …

Member Avatar for NormR1
0
966
Member Avatar for syeda amna

By using proper html. You align in the same way you would have aligned them if they weren't select tags. Do you use table tags? If yes then there is something wrong with your td,tr tags. Try to add the border="1" attribute at the <table> and see what is going …

Member Avatar for syeda amna
0
212
Member Avatar for masterjohji

[QUOTE=masterjohji;1584703]that doesn't help at all , it works on my netbeans ide 7.0.[/QUOTE] Net beans is an IDE. It has nothing to do with the code. If the code is correct it should work no matter how you run it. Also if the code was given to you and you …

Member Avatar for peter_budo
0
158
Member Avatar for anand01

Delete everything. Never put that code in a jsp. Have a class with a method that connects to the database, does whatever you want and returns the result. Call that method from the jsp.

Member Avatar for anand01
0
141
Member Avatar for ScubaSam

In the same way you studied and wrote all that code, you can do the same and create a gui. Surely, you shouldn't have a problem if you managed to study and write all that code, to program a gui. Look at your notes, create the gui and call the …

Member Avatar for iamthwee
-2
151
Member Avatar for reezox

Do you have any knowledge of java? Or any other programming language? The switch is the classic switch statement that you will find in any language. You will need to use scriplets. Try to find and read a book about jsps. If you are unfamiliar with java then you shouldn't …

Member Avatar for reezox
0
151
Member Avatar for sneaker

Maybe the admins should move the post to the "sticky" thread at the top of this forum with all the other resources about java.

Member Avatar for sneaker
0
566
Member Avatar for pankajagar2002

Hi, your question has already been answered in this forum. I had the same problem with you, but later I found the answer and posted it. Take a look at this thread: [URL="http://www.daniweb.com/web-development/jsp/threads/159630"]http://www.daniweb.com/web-development/jsp/threads/159630[/URL] It has my question, similar to yours, as well as the answer. One way would be to …

Member Avatar for javaAddict
0
102
Member Avatar for arshi9464

1 class -> 2 methods. 1 method that inserts 1 method that reads. Call those methods from the jsp. Create a class that saves the data as attributes. The rest of the code is wrong. The java is executed at the server. The javascript at the client. So when you …

Member Avatar for javaAddict
0
174
Member Avatar for b1izzard

If you take a closer look at the code: [CODE] for(i=0;i<size;i++) { String temp=jComboBox1.getItemAt(i).toString(); if(temp.equals(tbl_pname)) { flag=1; break; } } if(flag==0) jComboBox1.addItem(tbl_pname); [/CODE] No wonder it takes that long. You run the query and then inside the while loop you have another for loop. In other words, you use java …

Member Avatar for b1izzard
0
233
Member Avatar for lecoqsportif

First of all, explain better your problem. What do you mean ? [I]an illegal charater(inside red) - other than what is provided now[/I] Also the code you posted makes no sense. How is it connected with what you ask. Not to mention that this is how it should be written: …

Member Avatar for javaAddict
0
65
Member Avatar for leeRH

Don't give wrong advices, just so you can make a post and display your mail.

Member Avatar for kumarvishal_vk
0
309
Member Avatar for anandhikrishnan

First of it makes a lot of difference how you reload the initial page. If you have a link that goes from the action page to the search page, you can send the parameters back to the search page. How do you "loaded" from the action page. What do you …

Member Avatar for javaAddict
0
96
Member Avatar for smitdog1

[QUOTE=forhacksf;1560731]I found this looking for something and... dispose(); works well if you want to close one window, not all.[/QUOTE] The thread that you posted, is from 2004. Do you know that it is against the rules to revive dead threads?

Member Avatar for javaAddict
-2
500
Member Avatar for arshi9464

What actions do you take when you log in? How do you know the user is logged in? Also you can check the API for the session class. There is an invalidate method, I think, But answer first what I have asked and we'll see what needs to be done.

Member Avatar for javaAddict
0
83
Member Avatar for kanhakv

You are using something that is not declared or doesn't exists or is not visible from where you are trying to use it

Member Avatar for kanhakv
0
606
Member Avatar for darkdai

If you are using the window.open javascript function, then look at its API. There are parameters where you can set what you want: [URL="http://www.w3schools.com/jsref/met_win_open.asp"]http://www.w3schools.com/jsref/met_win_open.asp[/URL]

Member Avatar for javaAddict
0
61
Member Avatar for stephenk291

You don't say what is your problem. The code seems ok. Does it compile? Does it run? Does it give correct results? What are those logical issues?

Member Avatar for javaAddict
0
117
Member Avatar for jinglylime

Read the error messages that you get. The method "findBiggest" returns a Rectangle. So why do you assign it to an array when you call it. Also you cannot use: '>' with objects: [ICODE]if(rects[i] > biggestSoFar)[/ICODE] If you want to compare them based on their area, then call the getArea() …

Member Avatar for jinglylime
0
112
Member Avatar for arshi9464

Well the general idea would be to write 2 methods. One that saves the text file and the other saves the path. Those need to be independent with each other and with the rest of the program. That means: Write one method that takes as argument the text and the …

Member Avatar for javaAddict
0
138
Member Avatar for ronnieaka

Submit to the same page and add the code of the second page to the first. When the first page loads for the 1st time, the request is empty, it has [B][U]null[/U][/B], inside. So you can use that in order to decide what to display. Even if you submit the …

Member Avatar for javaAddict
0
1K
Member Avatar for Inevitable x7

Have you looked at the API. Check if there is a method to get the selected value of the JList. [URL="http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JList.html"]http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JList.html[/URL]

Member Avatar for javaAddict
0
356
Member Avatar for Poopster01

Read the error messages that you get. They tell you exactly what the problem is: cannot find symbol symbol : variable count The program cannot find the count variable. Have you defined it? Is it visible? Also when you do: DVDcollection[index] , the DVDcollection needs to be an array. The …

Member Avatar for javaAddict
0
324
Member Avatar for jeffrey o

Go at the line where the error tells you. You are using something there which is null. Something you haven't initialized. Also you cannot read a file if you don't know that it has enough lines in it. [CODE] String line = in.readLine(); while (line!=null) { System.out.println("Line read: "+line); // …

Member Avatar for javaAddict
0
233
Member Avatar for stephen lynch

You can start by explaining what a a restuarant bill calculator is? After you explain it, start converting that explanation into java classes, and the calculations needed into methods.

Member Avatar for javaAddict
0
494
Member Avatar for gogreen1

If you have used javascript and jquery before while developing web pages then you can put it, why not? You can never be sure how expert you are because there is always someone better, but if you are familiar with you can add it.

Member Avatar for javaAddict
0
65
Member Avatar for Stoss

What errors do you get and where are you having problems. The code seems ok. Which part of your assignment doesn't work. What test cases have you tried?

Member Avatar for javaAddict
0
243
Member Avatar for Web_Sailor

I didn't understand much from your question, but if you have read the data from the database, and you want to have a link, and put some data to the url of that link then: [CODE] <% String someValue=""; %> <a href="page.jsp?paramName1=<%=someValue%>&paramName2=....&paramName3=...." >Display Text</a> [/CODE] And at page.jsp: [CODE] String …

Member Avatar for javaAddict
0
68
Member Avatar for AmIAyTi

Usually when you have a check box and you submitted, then if it was not checked the request.getParameter("paramName") will return null, Otherwise it will return a not null value. Assuming that you have those check boxes in a for loop with index 'i', you can have the check box be …

Member Avatar for javaAddict
0
943
Member Avatar for sganderson

Why use StringBuffer and simply display at the hmtl the code: [CODE] <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html> <head> </head> <body> <font size="+1" color="#55BBEA">Not a member yet? Register here. It is FREE. </font><br> <html:form action="/register"> <table> <tr> <td align="left"> <bean:message …

Member Avatar for javaAddict
0
338
Member Avatar for coolbeanbob

[QUOTE=coolbeanbob;1549416]Are you saying strRead is null for the first line of the text file? I don't think that is the case, but I will try to verify that.[/QUOTE] [ICODE]students[p].parse(line1); //<==Null Pointer??[/ICODE] I believe that [I]Majestics[/I] is right. You initialize the students array, but the elements of the array are null. …

Member Avatar for jon.kiparsky
0
717
Member Avatar for AmIAyTi

[QUOTE=adil24;1546965][code] <td colspan="3"><input name="text4" id="vid" type="text"/></td> <td colspan="1"> <select name="combo1" onchange="document.getElementById('vid').value=this.option[this.selectedIndex].text"> <option>Select One</option> <% stmt=con.prepareStatement("Select id from student order by id"); ResultSet rst=stmt.executeQuery(); while(rst.next()) { %> <option><%=rst.getString("id")%></option> <% } } catch (Exception e) { System.out.println("error in program:-"+e); } %> </select></td> [/code] hope it might work for u..[/QUOTE] That code is …

Member Avatar for javaAddict
0
2K

The End.