1,963 Posted Topics

Member Avatar for deepak_nuniwal

[QUOTE=deepak_nuniwal;872287]ya sure its in my office desktop. i will bring n post here on monday. thanks.[/QUOTE] Till Monday then

Member Avatar for javaAddict
0
2K
Member Avatar for choybutchoy

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 …

Member Avatar for choybutchoy
0
144
Member Avatar for shanakaprabath

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) …

Member Avatar for solahere
0
1K
Member Avatar for Masood Ali

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 …

Member Avatar for Sakthimeenakshi
0
201
Member Avatar for majestic0110

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 …

Member Avatar for majestic0110
0
204
Member Avatar for guyod

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 …

Member Avatar for javaAddict
1
99
Member Avatar for anumitadas
Member Avatar for fullgl
Member Avatar for javaAddict
0
65
Member Avatar for choybutchoy

[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. …

Member Avatar for choybutchoy
0
129
Member Avatar for memegha123

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

Member Avatar for javaAddict
0
4K
Member Avatar for javaAddict

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 …

Member Avatar for h.sileem
0
445
Member Avatar for masterjiraya

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]

Member Avatar for dharmajava
0
307
Member Avatar for Tmanchester

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?

Member Avatar for Airshow
0
114
Member Avatar for memegha123

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 …

Member Avatar for javaAddict
0
151
Member Avatar for gshockneo

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 …

Member Avatar for gshockneo
0
997
Member Avatar for palavi

You can also check this: [QUOTE] java.lang.NullPointerException at parts.OraclePlm.main(OraclePlm.java:83) [/QUOTE] At line 83 something is null

Member Avatar for kvprajapati
0
363
Member Avatar for javaAddict

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 …

Member Avatar for The Dude
0
240
Member Avatar for Vmtr
Member Avatar for kuay

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 …

Member Avatar for ~s.o.s~
0
132
Member Avatar for kuay

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 …

Member Avatar for VernonDozier
0
81
Member Avatar for new_2_java
Member Avatar for kuay

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 …

Member Avatar for kuay
-1
384
Member Avatar for deepak_8917

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 …

Member Avatar for deepak_8917
0
343
Member Avatar for juhaa

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 %> …

Member Avatar for javaAddict
0
84
Member Avatar for CodeBoy101

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"); …

Member Avatar for javaAddict
0
12K
Member Avatar for solris

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]

Member Avatar for javaAddict
0
100
Member Avatar for farahshafilla

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 …

Member Avatar for kvprajapati
0
98
Member Avatar for kmullin
Member Avatar for dorota16

[URL="http://www.daniweb.com/forums/announcement9-2.html"]We only give homework help to those who show effort[/URL]

Member Avatar for javaAddict
0
984
Member Avatar for kuay

LONG LIVE THE CHIPMUNKS. You will never silence the voice of freedom fighter (not terreorist) 'IndyBoy'!! :) But seriously, who came up with this assignment???

Member Avatar for kuay
0
94
Member Avatar for farahshafilla

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

Member Avatar for javaAddict
0
82
Member Avatar for anshusharma

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 …

Member Avatar for anshusharma
0
108
Member Avatar for samrin

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); …

Member Avatar for samrin
0
121
Member Avatar for exzibit23

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?

Member Avatar for ~s.o.s~
0
4K
Member Avatar for nagachaitanya

[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" …

Member Avatar for JamesCherrill
0
115
Member Avatar for Ankita B

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 …

Member Avatar for deepak_8917
0
171
Member Avatar for mc080201812
Member Avatar for mc080201812

[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 …

Member Avatar for javaAddict
0
85
Member Avatar for anshusharma
Re: jsp

[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. …

Member Avatar for peter_budo
0
99
Member Avatar for sciwizeh
Member Avatar for brandongood

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 …

Member Avatar for brandongood
0
93
Member Avatar for puneetkay

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 …

Member Avatar for puneetkay
0
168
Member Avatar for weblover

Add a log message in the function. Example: System.out.println( "Method called" )

Member Avatar for weblover
0
98
Member Avatar for stewie griffin

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 …

Member Avatar for stewie griffin
0
103
Member Avatar for djdanjo82

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 …

Member Avatar for javaAddict
0
142
Member Avatar for jackiejoe

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?

Member Avatar for javaAddict
0
535
Member Avatar for Xessa

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 …

Member Avatar for Xessa
0
120
Member Avatar for titosd

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

Member Avatar for masijade
0
99
Member Avatar for coolbuddy059

[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]

Member Avatar for javaAddict
0
112
Member Avatar for _Rosie_

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 …

Member Avatar for stultuske
0
131

The End.