1,963 Posted Topics

Member Avatar for localp

[QUOTE=Ezzaral;886483]Well, the first hint would be the exception itself, which you did not specify here. I would recommend using executeUpdate() which returns the number of rows affected instead of executeQuery(), which return a result set.[/QUOTE] I thought that you cannot use [I]executeQuery[/I] for "insert", "update", "delete" queries. Anyway apart from …

Member Avatar for ~s.o.s~
0
260
Member Avatar for freelancelote
Member Avatar for Xessa

I took this example: [CODE] <select multiple="multiple"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> [/CODE] From this site: [URL="http://www.w3schools.com/tags/att_select_multiple.asp"]http://www.w3schools.com/tags/att_select_multiple.asp[/URL]

Member Avatar for jodin
0
210
Member Avatar for George2

[QUOTE=aru211285;887170]i need to extract the number part from the string which looks like "(7 r 8digits).txt". i need to store this found string in some variable, but i am confused wih the groups twhether o get the string as group() or group(1). Pattern p = Pattern.compile("\b[0-9]{7,8}\b"); Matcher matcher = p.matcher("num"); …

Member Avatar for javaAddict
0
447
Member Avatar for sravan953

For calculating the sum try something like this: 1+2+3 + ... + i + .. [CODE] int sum = 0; for (int i=1;i<N;i++) { sum = sum + i; } [/CODE] Also there is this method: [ICODE]Math.pow(a,b)[/ICODE]. Calculates the power: Math(2,3) = 2^3 = 8 Now let's see some code

Member Avatar for javaAddict
0
86
Member Avatar for puk
Member Avatar for JohnPhilipps

It depends on how you want to parse it. If you managed to read each line in the 'record' variable perhaps you should look at the String class. There are methods like split() and substring()

Member Avatar for JohnPhilipps
1
255
Member Avatar for mrriz

[QUOTE=mrriz;885832]dis shite shzucks[/QUOTE] You will find no servants here that are obligated to answer to your questions. If you didn't get a reply it was probably because people didn't know the answer or they were busy with their own (personal or not) problems. No one here has anything against you …

Member Avatar for Xhamolk_
0
114
Member Avatar for shakeelahmed22

Also another thing: Outside the constructor you do this: [CODE] int n; int array[] = new int[n]; [/CODE] In that way you set the array to be 0 size, since 'n' is zero. I believe that 'n' should be the argument of the constructor: [CODE] int N; int array[] = …

Member Avatar for javaAddict
0
166
Member Avatar for Xessa

[QUOTE=serkan sendur;883443]i dont understand why adatapost is obsessed about increasing his solved post numbers. i cant see any other useful motivation for this behaviour of approving the previous posts.[/QUOTE] If you see how [I]adatapost[/I]'s reputation goes up and down you will realize that you are not the only one who …

Member Avatar for kvprajapati
0
128
Member Avatar for shakeelahmed22

The answer is simple English grammar: A method [B][COLOR="Red"]throws[/COLOR][/B] an Exception: [CODE] public void method(int i) throws Exception { } [/CODE] The method [B][COLOR="Red"]throws[/COLOR][/B] an Exception when you call it But you [COLOR="Green"][B]throw[/B][/COLOR] an Exception: [CODE] if (i<0) throw new Exception(); [/CODE] If 'i' is negative you will [COLOR="Green"][B]throw[/B][/COLOR] an …

Member Avatar for shakeelahmed22
0
111
Member Avatar for still_learning

Declare an int variable and whenever you do a comparison increase its value by one

Member Avatar for kvprajapati
0
386
Member Avatar for mamatachaudhari
Member Avatar for mamatachaudhari
Member Avatar for mamatachaudhari

Maybe this will help: [URL="http://struts.apache.org/2.0.11/docs/select.html"]http://struts.apache.org/2.0.11/docs/select.html[/URL] And a complete reference: [URL="http://struts.apache.org/2.0.11/docs/tag-reference.html"]http://struts.apache.org/2.0.11/docs/tag-reference.html[/URL]

Member Avatar for mamatachaudhari
0
2K
Member Avatar for f.damati

[QUOTE=f.damati;875888]I know the methods, but when i use them they throws java.lang.NullPointerException[/QUOTE] You get that exception because you haven't initialized the objects. You have create something with "new" in order to use it.

Member Avatar for javaAddict
0
178
Member Avatar for dep.new
Member Avatar for javaAddict
0
76
Member Avatar for jamojo

Actually if you use the getDate(), it will return a java.sql.Date, which doesn't hold the milliseconds. When I want to get date from database I usually do this at the query: [CODE] TO_CHAR('format', date_column); [/CODE] And then use the ResultSet.getString() method

Member Avatar for masijade
0
162
Member Avatar for brandongood
Member Avatar for kimbirdy09
Member Avatar for fuzzyrose

[QUOTE=fuzzyrose;874184]I tried to compile it in linux but it didn't work.[/QUOTE] If it didn't work, why didn't you post the errors you were getting in first place?

Member Avatar for kvprajapati
0
238
Member Avatar for javaAddict

Hi everybody, I have found these books [URL="http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134/ref=sr_1_1?ie=UTF8&s=books&qid=1242936833&sr=1-1"]Learning OpenCV: Computer Vision with the OpenCV Library[/URL] from [B]AMAZON[/B] and this: [URL="http://www.papasotiriou.gr/product.ebook.asp?pfid=1761941&prid=1016178"]Learning OpenCV[/URL] from my [B]LOCAL[/B] store Which one do you suggest to buy? Should I wait and order the first one? OR is the second at my local store as good …

Member Avatar for jephthah
0
101
Member Avatar for kashn

There are many examples on how to read files in this forum. After you read each line, check if it has value an empty String: [CODE] if (line.trim().equals("")) { // this is an empty line // the new line would be the start of a new paragraph } [/CODE]

Member Avatar for javaAddict
0
219
Member Avatar for Frostra

You don't specify what is your problem. And if this doesn't work: [CODE]return ((a.add(b.mul(x))).add((c.add(d))).mul(x.power(6)));[/CODE] there is no way to understand what is wrong. Better try splitting them and printing the result separately to see where the error is

Member Avatar for javaAddict
0
168
Member Avatar for Poppystar

Don't forget to close the ResultSet, the Statement, and the Connection. Also instead of while you could use an 'if'. If more than one row is expected, use 'while', but like this: [CODE] returnInfo = ""; while (rec.next()) { returnInfo += "DVD : " + rec.getString("Title") + "\t" + rec.getString("Genre") …

Member Avatar for Poppystar
0
579
Member Avatar for lifeismusic434

[URL="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html#setModel(javax.swing.table.TableModel)"]setModel[/URL] Also check the [URL="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/table/TableModel.html"]TableModel[/URL] [URL="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/table/DefaultTableModel.html"]DefaultModel[/URL]

Member Avatar for lifeismusic434
0
101
Member Avatar for airey1988

Loop through the list like an array. Only this time use the size() as upper limit. Use the get(int i) method to get the element of the list. Have you looked at the API for the List? If you are having problems with a class, always look the API: [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html"]http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html[/URL] …

Member Avatar for giri.pankaj
0
81
Member Avatar for javaAddict

Hi, I am trying to use this method: [URL="http://www.cs.indiana.edu/cgi-pub/oleykin/website/OpenCVHelp/ref/OpenCVRef_CxCore.htm#decl_cvCheckArr"]cvCheckArr[/URL] As a parameter I pass an IplImage and it compiles, but when I tried to run got this error: "Unsupported format in function: cvCheckArr .cxmathfuncs.cpp " I checked the above file and found from the code that it tries to convert …

0
75
Member Avatar for mmmusa

[QUOTE=abbie;870355] I hope you don't post again; not such a post, at least.[/QUOTE] Even though you are [U]right[/U], that was rather rude. You could have suggested for [I]mmmusa[/I] to post what he has done so far if he/she want some real help, instead of discourage him like that

Member Avatar for javaAddict
0
219
Member Avatar for airey1988

If you want to call a method like that : [ICODE]Customer2.setName[/ICODE] it should be static. In your case it is correct to have them NON-static; but you create a "Customer" objetct: [ICODE]Customer customer = new Customer(); [/ICODE] and them call the "Customer2" ?? What are you trying to do?? Shouldn't …

Member Avatar for birina
-1
1K
Member Avatar for shijunair

First of all what type of argument does [ICODE]ps.setDate()[/ICODE] have and what type are the to_date, from_date at your database? Also if you need to convert a String to a Date try this: [CODE] String sDate = 01/04/2009; // 1st of April String format = "dd/MM/yyyy" SimpleDateFormat sdf = new …

Member Avatar for shijunair
0
2K
Member Avatar for sneharaveendran
Member Avatar for sneharaveendran
0
98
Member Avatar for suse17
Member Avatar for kingarabian

depending on the value of i_0_ it calls certain methods with some parameters and returns them

Member Avatar for kingarabian
0
128
Member Avatar for peedi

Whenever you generate a new random number before you put it at the array check if the array already has it. If it does calculate it again, else put it and generate the next number.

Member Avatar for BestJewSinceJC
0
5K
Member Avatar for grisha83
Member Avatar for sanatkumar

what are you trying to accomplish? Beacause when a main calls a main method, the second main will again call the main method, which will again call the main method, which will again call the main method, which will again call the main method, OH NO, the stack is full, …

Member Avatar for kvprajapati
0
105
Member Avatar for DealthRune

You can at least use this: [CODE] <input type="password" name="pass" id="pass" /> [/CODE] When the user clicks the button use javascript to get the value of the field and do whatever you want. But you shouldn't use javascript for password authentication

Member Avatar for ShawnCplus
0
131
Member Avatar for Nisaac

[QUOTE=Nisaac;858397]//amount of accounts : 320 Account #/PIN/amount/type 30 39743 57.35 b 44 61405 68.96 l 9935 25686 2.67 l 9941 77300 9.8 b[/QUOTE] Posting hundrends of lines will help us understand but if you just posted a few line like I did wouldn't ?

Member Avatar for Nisaac
0
206
Member Avatar for puk

You can search this forum for examples on how to use the BufferedWriter class: [CODE] BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(new File(fileName))); writer.write("Write this to file"); writer.newLine(); } catch(Exception e) { System.out.println(e.getMessage); } finally { try { if (writer!=null) writer.close(); } catch (Exception ex) {} …

Member Avatar for javaAddict
0
74
Member Avatar for samanrz

I believe you can use the name attribute as well. Also I think that you are closing the for loop at the wrong place. With your way it should have been after the <tr> [CODE] for(int i=0;i<f.length && f[i]!=null ;i+=3){%> <tr> <td> <form action="cart.jsp" method="get"> <%out.println(f[i+1]); %><br> <%out.println(f[i+2]); %> $ …

Member Avatar for peter_budo
0
95
Member Avatar for deepakyadav1830

[URL="http://java.sun.com/javase/6/docs/api/java/util/HashMap.html"]http://java.sun.com/javase/6/docs/api/java/util/HashMap.html[/URL]

Member Avatar for javaAddict
0
247
Member Avatar for llemes4011

Try this site with tutorials: [URL="http://www.w3schools.com/"]http://www.w3schools.com/[/URL]

Member Avatar for llemes4011
0
37
Member Avatar for transplantedNYr

Well for reading a file I use BufferedReader: [CODE] String fileName="C:/folder1/file.txt" BufferedReader reader = new BufferedReader( new FileReader(fileName) ); String line = reader.readLine(); while(line!=null) { System.out.println(line); line = reader.readLine(); } [/CODE] First you need to read the first line which happens outside the loop. Then in order to enter the …

Member Avatar for transplantedNYr
0
160
Member Avatar for zyaday

Create a seperate Project with some classes and then you can import these classes like you import any other class: [CODE] import java.util.* [/CODE] The only difference is that you will be importing your classes with their packages. You can take the .class files (in their folder/package) or create a …

Member Avatar for kvprajapati
0
197
Member Avatar for marco01

One of your variables is a List, so natuarally you cannot add ("+") a list to an integer

Member Avatar for marco01
0
105
Member Avatar for benatschool

Your GC has nothing to do with it. Here is a small example that will help you understand what you are doing: [CODE] Person p = new Person(); p.setName("My Name"); System.out.println(p.getName()); // will print My Name p = new Person(); System.out.println(p.getName()); // will print null [/CODE] You successfully create the …

Member Avatar for javaAddict
0
117
Member Avatar for yesntu09

You can read the input from the console using the Scanner class and store that into variables. Then use these variables at your query: [CODE] String street = "myStreet"; String query = "SELECT vendorid, vendname FROM vendors where street = '" + street + "'"; [/CODE]

Member Avatar for javaAddict
0
108
Member Avatar for tayhaithian

Even if the database is updated you also need to update the comboBox as well by removing the book selected if the deletion was successful.

Member Avatar for javaAddict
0
131
Member Avatar for Grn Xtrm

why you say it doesn't work. I have run it like this: [QUOTE] Enter the number of values to be added to the list 4 Input the values 4 3 2 1 [1, 2, 3, 4] [4, 3, 2, 1] [/QUOTE] As you can see the array 'a' is sorted …

Member Avatar for Grn Xtrm
0
234

The End.