2,443 Posted Topics
Re: Well, what would happen if the connection (or something else) failed before the code ever got to the point where the ResultSets could be created? The would be "uninitialised", right? Since they have never had a value assigned to them, right? So, on the lines where you declare them, why … | |
Re: Java is not even [i]close[/i] to "a slow death", as you call it. The largest problem with .Net is that it runs only on Windows and [i]most[/i] server architectures (which is where most commercial activity takes place) are [i]not[/i] Windows. I know, I know, .Net, in theory, can run anywhere, … | |
![]() | ![]() |
Re: Let us see your code and we will help you correct (when you tell us exactly what errors you are getting), but this is not a homework service. We will not do it for you. That is, in fact, against the terms of use that you agreed to you when … | |
Re: remove those brackets from the end of the variable name, both when calling the method [i]and[/i] in the declaration. In the declaration, place them after int, not after value (they both work but this way is clearer). Edit: And I [i]hope[/i] that that "generate" signature is not a serious attempt. | |
| |
Re: You would be better off using a "DB" approach. Even if it is a "homegrown" type thing using RandomAccessFile, but better would be something like JavaDB/Derby. | |
Re: Post your algorithm and we will, probably, give you hints and nudges to help you increating a method that implements it. | |
Re: An instance variable of Class Array (which is the class behind [i]all[/i] arrays). It is an int. Edit: And, as noted, it represents the length of the array, and since arrays are 0-indexed, the last index of the array is length - 1, of course. | |
Re: As in? What exactly do you want to know? toString is a method of Object. Object is implicitly extended (somewhere in the hierarchy chain) by [i]every[/i] Class. So, every Class has a toString method. Usually it prints some standard String derived from Objects toString method (see the API docs to … | |
Re: An NPE provides a Line number in the exception messgae, what is it? | |
Re: That deprecated warning also tells you what you should done (i.e. recompile with the -Xlint:deprecated option). Have you done that? | |
Re: Yeah, well, I see where you create a JFRame, a JPanel, and a JTable, but no where do I see where you add the JTable to the JPanel, or the JPanel to the JFrame, or the JTable, to the JFrame, etc, etc, etc, so, yeah, you see a blank JFrame. … | |
Re: executeUpdate returns an int indicating the number of rows affected by the query. It does not return a ResultSet. | |
Re: Make an [i]attempt[/i], at least. If it "doesn't work" then post that code and describe, [i]exactly[/i], what "doesn't work" mean and provide all (and complete) compiler/error messages. This is [i]not[/i] a code service. | |
Re: What makes you think you can? You can't. | |
Re: Yes, study what the code is suppossed to do and then program it in Java. Simply "converting" it would only create a hack that would be [i]far[/i] from effecient. | |
Re: Ask about mime types and file associations at an MS forum. | |
Re: 8080 almost definately not, and you should, of course, be using "jdbc:[b]oracle[/b]:thin", not "jdbc:odbc:thin", of course. | |
Re: And for general information read [url=http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html]this article[/url] thoroughly. You are falling into the "not a command" trap. But Peter is correct, you should [i]not[/i] be using Runtime for this, [i]at all[/i]. | |
Re: If they are both on the same machine, or have access to a reliable shared disk (although the processes that create and maintain that shared disk also use sockets, so I guess that one doesn't count) yes. Is it practical? No. Is it effecient? No. Does it make any kind … | |
Re: That is an OS specific question. No programming language has anything to do with the file and user rights system of the OS on which it is running. | |
Re: for the "beginning" of the scrollbar [code] scrollPaneVar.getHorizontalScrollBar().getValue(); scrollPaneVar.getVerticaalScrollBar().getValue(); [/code] Add these values to the above values to get the "end" of the scrollbar [code] scrollPaneVar.getHorizontalScrollBar().getModel().getExtent(); scrollPaneVar.getVerticaalScrollBar().getModel().getExtent(); [/code] Divide those summed values by 2 to get the "middle" of the scrollbar. See the API docs for JScrollPane, JScrollBar, and BoundedRangeModel. | |
Re: That semi-colon ( ; ) at the end of your for statement ends the for loop. | |
Re: Nothing to do with Java, to tell you the truth. The signal that the Wii uses, and what (and how, i.e. in what form) data is transmitted/received over that signal is what's at issue, and that is [i]completely[/i] language independent. Try to find the signal, then read the bytes from … | |
Re: Neither of which are options in Java. Those would be OS specific options and you would have to write a JNI library per OS to be able to do something like that, so, if you are going to pursue this course of action, start asking at an OS specific forum … | |
Re: Redirect STDERR and STDOUT to a file and see what shows up there, first. You can't diagnose anything without gathering any information. | |
Re: Add a single JPanel to the JScrollPane. Use FlowLayout with vertical (or horizontal, depending on which way you want to "scroll") alignment in that JPanel, and add the JPanels that are to be added "dynamically" to that JPanel. Then, don't forget to call validate() and/or repaint() on the JScrollPane. | |
Re: You should not be calling "paintComponent" directly. You should be calling validate() and/or repaint() on the component. | |
Re: You are never actually getting the file sizes. Where in that code do you do file_size += whatever ? | |
Re: replace all single slants with double slants before (or while) calling "aregex". [code]str.replace("\\", "\\\\")[/code] note: replace, [i]not[/i] replaceFirst or replaceAll. | |
![]() | Re: matches and toLowerCase ? See the API docs for String |
Re: [url]http://java.sun.com/docs/books/tutorial/deployment/jar/index.html[/url] [i][b]again[/b][/i] | |
Re: You need a mobile phone attached to your computer, probably, and probably a specific type, or an internet gateway, to which you would probably need a subscription. Check with whoever/wherever you got that "SMS" and "IntelliSMS" class. | |
Re: As long as you're not doing any Runtime.exec type stuff you shouldn't have any problems. You [i]will[/i] want to test it, first, though. | |
Re: HttpURLConnection and its getInputStream method. | |
Re: The line [code]JLabel label[] = new JLabel[ numLabels ];[/code] creates an array of "numLabels" length containing references of the [i]Type[/i] JLabel, but with [i]value[/i] null. You still have to initiate the individual elements. I.E. [code]label[i] = new JLabel();[/code] | |
Re: Use an HTML parser of some sort. Google for one. Adding it to the JNLP list or the archive tag will make it available to an applet from the server. | |
Re: Uhm, is this a webapp? If so, simply save the bean to the session. If it is not a webapp, save the bean elsewhere (Preferences. maybe). Assuming this is simply a "user profile" bean and not actual "data", as that is more view related than data related. | |
Re: Well, that, and the missing quote where you set name, and the fact that you are simply resetting local values in that constructor rather than setting the instance values, but I'll assume you know all that by now. | |
Re: It might help to see what it is you are doing inside that while loop, but I will explain the most likely cause. That being, performing an execute on a statement automatically closes all resultsets associated with that statement so, if you do something like this [code]Statement s = conn.createStatement(); … | |
Re: [code] // code related to antivirus [/code] There I wrapped "code related to antivirus" in code tags. Try Google, please. If that doesn't work, try asking specific questions, not "give me teh codez". | |
Re: Because Strings are immutable. You cannot change it's content, you can only create a new String containing modified content, so [code]str.replace('x', 'k');[/code] should, of course, be [code]str = str.replace('x', 'k');[/code] | |
Re: This [code] ps.setString(1, newUser);<--------------------[/code] is not your problem. This [code] ResultSet rs = ps.executeQuery(); System.out.println("ResultSet rs= : "+rs.toString()); String password = rs.getString(1);[/code] is your problem. You have not called next() (or first()/last()/etc. for scrollable resultsets) before calling getString() so the current "cursor position" is [i]before[/i] the [i]first[/i] row, i.e. not … | |
Re: Uhm, use next() and then toCharArray() and access the chars that way. | |
Re: [QUOTE=OffbeatPatriot;1221504]But I've been told that in Java the base hash code of an Object is simply the memory address of the object[/QUOTE] As has been implied already, someone told you wrong. | |
Re: Well, post what you have so far, we are [i]not[/i] simply going to do it for you. | |
Re: Uhm, new Timestamp(dateVar.getTime()), maybe? (Combinded with PreparedStatements setTimestamp, of course.) You are doing this stuff in external Java Classes (earlier Beans, now POJOs), right? | |
Re: I assume all of these "Actor" classes extend the same base class? If so, add a getInstance(WhateverThisCodeThigIs code) abstract method to that class and override it in all of the other classes. | |
![]() | Re: Create a class that extends FilenameFilter (not FileFilter) (and it can even, easily, be an anonymous inner class) and use the setFilenameFilter method of FileDialog. Let's see your attempt at that (BTW a [i]quick[/i] look at the API docs [i]should[/i] have pointed this out, FileDialog only has about 10 methods). … |
The End.