1,963 Posted Topics
Re: [QUOTE=deepak_nuniwal;872287]ya sure its in my office desktop. i will bring n post here on monday. thanks.[/QUOTE] Till Monday then | |
Re: First this could be helpful: [CODE] select count(*), col_1, col_2 from myDatabase [/CODE] Each "row" of the ResultSet will have the row count as well as the columns. Also you can run 2 queries. The first that will get you the row count The second that will get you the … | |
Re: Here is another code snippet that might help: [CODE] BufferedReader reader = null; try { reader = new BufferedReader(new FileReader("fileName")); String line = reader.readLine(); while (line!=null) { // do whatever you want with line System.out.println(line); // this MUST be the last command: line = reader.readLine(); } } catch (IOException ioe) … | |
Re: Another way with sysdate is: [CODE] select * from table where StartDate = sysdate [/CODE] or better the following will check only the date without taking into account the hours, minutes: [CODE] select * from table where trunc(StartDate) = trunc(sysdate) [/CODE] With the first, these dates will be unequal: [U]27/07/2009 … | |
Re: Classes begin with capital. Methods with lower. [CODE] StringConcatenate stringConcatenate1 = new StringConcatenate(); stringConcatenate1.stringConcat(); [/CODE] You create an object/instance of type StringConcatenate. And you call the method stringConcat() of the instance stringConcatenate1. Most of the time different instances have different results when they call the same method: [CODE] StringConcatenate string1 … | |
Re: The way you do it with any other method: [CODE] public double method(int i) { return i*2.5; } .... public static void main(String [] args) { double r = method(2); } [/CODE] Look the java API (java.util.ArrayList) for the methods and constructor of the ArrayList. Create a constructor at the … | |
Re: The correct is: import java.util.Scanner; not: import.java.util.Scanner; | |
Re: [QUOTE=choybutchoy;929973]hi guys, how can I retrieve the total record count from a database? I mean is there a method like "rst.recordCount"? or whatsoever? thanks...[/QUOTE] If you run this query at an SQL editor: [CODE] select count(*) from your_table [/CODE] It will get you the number of rows that table has. … | |
Re: When the onchange method is called you can submit the form to a servlet. Then read the data and come back to the jsp. Read the first post at the jsp forum for more details on how to connecti jsp and servlet with database | |
Hi all, I am having problem with openCV: I am using Microsoft Studio 2008 From this lnk: [URL="http://sourceforge.net/projects/opencvlibrary/"]http://sourceforge.net/projects/opencvlibrary/[/URL] I downloaded the [U]OpenCV_1.1pre1a.exe[/U] for windows and installed it. I have been searching ways to include the libraries installed but the instructions don't seem to match my VS version? So after creating … | |
Re: If I understood correctly you want the user to enter characters? Then you already have the code: [CODE] option=stdin.readLine(); [/CODE] All you have to do is check the "option": [CODE] if (option.equalsIgnoreCase("M")) { } [/CODE] | |
Re: First of all what do you mean by custom tag? Second, I believe that they should behave the same, whether it is clicked with a mouse or by pressing <Enter>. If I am wrong someone please correct me. And third, is it possible to see some code? | |
Re: First of all you will need javascript: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL] There is the onchange function. You can have the form submit there: [CODE] <form name="formName" action=""> <select name="param" onchange="document.formName.submit()"> ... </select> </form> [/CODE] Then at the beginning of your jsp: [CODE] <% String param = request.getParameter("param"); if (param!=null) { // form was … | |
Re: First of all, I don't think it is a good idea to put at the session the password. Second if you need more than one users then: [CODE] session.setAttribute("user_1",request.getParameter("name")); ... session.setAttribute("user_2",request.getParameter("name")); ... session.setAttribute("user_"+counter,request.getParameter("name")); counter++; [/CODE] The counter could be an int variable also stored in session. Every time a user … | |
Re: You can also check this: [QUOTE] java.lang.NullPointerException at parts.OraclePlm.main(OraclePlm.java:83) [/QUOTE] At line 83 something is null | |
Hi everybody, I hope that this is the right forum to post this. I just received a rather strange PM from someone. They were asking me for my bank account number in order to deposit a great amount of money. The PM had an extensive story why they want my … | |
Re: Let's take the first word: "NS" and the letter 'N' The alphabet goes: "[B]N[/B]", "O", "P", "Q", "R", "[B]S[/B]" You program returns: "SX": 'S' As you can see if you add 5 to 'N' at the sequence I gave you (N, O, P, Q, R, S) the 5th letter after … | |
Re: This is not the same code you had at your previous thread. Why did you changed it? Also why are you checking this: if(c < 'C') BEFORE you call this: c = c - (key % 26) Also why are you using this character: 'C'. I already explained what you … | |
Re: We will need more than this. Perhaps your code. | |
Re: First of all, [I]osiris003[/I] you are wrong. Second [I]kuay[/I] you had a thread started, I posted an answer, you asked another question and then started a new one with same question. I already gave you an answer to your first thread but now I need to answer again in this … | |
Re: Apart form Peter's suggestion I will like to add something. First if you are reading the data in one jsp why aren't you displaying them in the jsp you are reading them? Or why don't you read the data at the jsp that the link takes you? It makes no … | |
Re: Read this: [URL="http://www.daniweb.com/forums/thread141776.html"]JSP database connectivity according to Model View Controller (MVC) Model 2[/URL] Also for creating a link, try this: [CODE] String url = "http://www.daniweb.com"; .... <a href="<%= url%>">Click here</a> [/CODE] or [CODE] String url = "http://www.daniweb.com"; String value = "Dani Web Forum"; .... <a href="<%= url%>"> <%= value %> … | |
Re: If you want to use java it must be done at the server. Meaning before you render the page. For example. Put a value at the request [ICODE]request.setAttribute("key","The Value")[/ICODE] Then submit, redirect or whatever and at jsp, get it and put it at the field: [CODE] String something = (String)request.getAttribute("key"); … | |
Re: Because: "[I]C:/Users/Solris/Desktop[/I]" is NOT a file. It is a Directory. Shouldn't you do something like this: [ICODE] File f = new File("C:/Users/Solris/Desktop/file.txt"); [/ICODE] | |
Re: If I understand correctly (if I don't you should have provided a better explanation) you want to insert a new order in a database? If yes there is an SQL command when you create a table where you set the Primary Key to be auto increment so when a new … | |
Re: What is the full name of the file you are trying to compile? | |
Re: [URL="http://www.daniweb.com/forums/announcement9-2.html"]We only give homework help to those who show effort[/URL] | |
Re: LONG LIVE THE CHIPMUNKS. You will never silence the voice of freedom fighter (not terreorist) 'IndyBoy'!! :) But seriously, who came up with this assignment??? | |
Re: If you look at this very obvious part of the exception: [QUOTE] ...... org.apache.jasper.JasperException: An exception occurred processing JSP page /upload_page.jsp at line 22 ...... 22: saveFile = saveFile.substring(saveFile.lastIndexOf("\\")+ 1,saveFile.indexOf("\"")); ............ java.lang.StringIndexOutOfBoundsException: String index out of range: -83577 java.lang.String.substring(String.java:1938) [/QUOTE] The reason why you get the error is quite clear | |
Re: If you don't get an answer soon don't start another thread asking the same thing. What did you expect? That the very first minute you posted everyone should give you the solution? Your impatience was very annoying, flooding the forum with new threads. We are not here to serve your … | |
Re: Use code tags. If you can't use code tags don't just say the error is at line 5. Try to point out where the error is. What if the error was at line 100. Should we count 100 lines? And the answer is this: You wrote: [CODE] public SavingsAccount(double bal); … | |
Re: Maybe the [I]username_ctr[/I] which you increment inside the catch becomes greater than 5. Meaning that you need to add some debugging messages like printing the value of [I]username_ctr[/I]. Also I believe that you are sure that inside the catch you don't get another exception? | |
Re: [QUOTE=nagachaitanya;891773]1. a. Create a parent class "Vehicle" with one method "turnLeft" that prints "Vehicle turning left". b. Create a child class "Bike" which overrides the "turnLeft" method and prints "Bike turning left". c. Create a Vehicle reference referring to a Bike object. Is it legal? What happens when the "turnLeft" … | |
Re: I don't know if there are better ways to do it but here is my suggestion. When the user logs in take the username and when the user goes to another page, send the username with the other data as hidden: <input type="hidden" value="<%= username%>" name="username"> When you get to … | |
Re: [QUOTE=adatapost;891701]Welcome mc080201812. Before you post anything you must read [URL="http://www.daniweb.com/forums/announcement9-3.html"]How to post your problem & source code?[/URL] Source code must be surrounded with BB code tags. Your post must be moved to JSP forum.[/QUOTE] So from what you have read, that was the problem with [I]mc080201812[/I]'s post. Not using code … | |
Re: [QUOTE=anshusharma;891600]anybody online there, i want the solution of my problem.i will feel free to discuss the code of my aplication[/QUOTE] You were very smart to PM me the description of your problem and then posting again asking for the answer without explaining anything. Then double posted asking the same thing. … | |
Re: That's because this for loop is never executed: [CODE] for (index = 10; index > array.length; index--) arrayCopy[index] = array[index]; [/CODE] 'index' has value 10, array.length has value 10. you say: [ICODE]index > array.length;[/ICODE] which translates: [ICODE]10 > 10[/ICODE]. It will return false and you will not go inside the … | |
Re: You may need unicode to print characters that are not supported. Like having an application that needs to print messages in various languages (English, German, Chinese) depending on user's selection. It is used for internationalization. In one of my projects we had different property files used for resource bundles to … | |
Re: Add a log message in the function. Example: System.out.println( "Method called" ) | |
Re: You can have the class extend the Thread class. If you don't want to change the code of the old class though you can try to create a new one that extends the old and implements the Runnable interface: [URL="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html"]Runnbale[/URL] [CODE] public NewClass extends OldClass implements Runnable { public void … | |
Re: Firstly I don't believe that this is your code. Secondly look at the API of the File class. It has a method that accepts a filter and returns the file names that satisfy that filter. The method is similar with the one used at the code so would be able … | |
Re: Have you checked the API for List? When you say the same, you mean the same Object (reference) or the Objects have the same value? Have you tried looping the List? | |
Re: From what I understood, first you delete and then you insert, when you want to do an Update. Well you can try and run an Update query. When you "SELECT" data from the database you use a userID as you say in your example. Probably you use it at your … | |
Re: Usually when I use SimpleDateFormat I always use this method: [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html#setLenient(boolean)"]SimpleDateFormat.setLenient(boolean)[/URL] I set it to false in order for the parse, format methods to throw an Exception if the String I am trying to parse isn't an exact Date according to the format | |
Re: [QUOTE=adatapost;888661]SimpleDateFormat class is needed [CODE=Java] ...... String yourdate="12-Aug-2009"; String currformat="dd-MMM-yyyy"; SimpleDateFormat fd=new SimpleDateFormat(currformat); Date d1=fd.parse(yourdate); System.out.println(d1); String newformat="dd-MM-yyyy"; fd.applyPattern(newformat); StringBuffer b=new StringBuffer(); System.out.println(fd.format(d1,b,new FieldPosition(0))); .... [/CODE][/QUOTE] You could have printed this: [CODE] //fd.format(d1) System.out.println( fd.format(d1) ); [/CODE] | |
Re: The fact remains that you took the class that lasted several months. Meaning that all this time you should have studied. We have taken many exams on subjects that were for only 1 year and we would never come across again but that is not an excuse not to have … |
The End.