2,443 Posted Topics
Re: So what is your question? No one is going to write these programs for you. | |
Re: [QUOTE=thekashyap;329975]So what's teh question and where is teh "class Scanner " ?[/QUOTE] Scanner is a part of the JDK Since 1.5 (if not 1.4.2). @OP Before you start the loop, you need to declare and initiate an array with the variable "value" after your first question. [code] int arrayname = … | |
Re: [QUOTE=peter_budo;331166]Try this way ;) [code] public String ins_Deposit(String userid,int amount,String branch,String bank) throws SQLException { Statement ps = null; [COLOR="Red"][B]String output;[/B][/COLOR] try { ps = conn.createStatement(); String query="INSERT INTO BANK_TRANSACT VALUES('"+userid+"',sys_date,"+amount+",'D','"+branch+"','"+bank+"')"; int result = ps.executeUpdate(query); if(result>0) [COLOR="Red"][B]output = [/B][/COLOR]"Transaction successfully completed,amount will be credited to your account within 24hrs. "; … | |
Re: What happens, if it makes it all the way to the last nested if statement and that statement evaluates to false instead of true? What value would c have then? None because it hasn't been initialised. Add an else to the last nested if and the error will go away. | |
![]() | Re: Look at this from your code: [code] try { //Reads keyboard input and acts accordingly input = stdin.readLine(); }catch (IOException ex) { System.out.println("Problem reading from the keyboard"); iInput = Integer.valueOf(input); // convert String to Integer } [/code] You convert your string input to an integer only when an exception happens. … ![]() |
Re: [quote] [code] package class card; [/code] [/quote] I'm sorry, but don't you see anything wrong with this line? Both package and class are reserved words of a type that can't be used together, so it is more than passing strange to see them one after the other for one. For … | |
Re: .pm files are "Perl Modules" rather than perl scripts. They are Perl's objects. | |
Re: Well, first of all, it would be much safer and reliabe to use a PreparedStatement rather than a Statement. Second of all, a JSP is meant for viewing, changes/actions should happen in a Servlet, and scriptlets should not be used at all in JSP. Also, if you must actually check … | |
Re: If you are using JDK 1.5 or later, check out the "format" method of String. And actually follow and read (completely) the "format string" link contained within the description for that method. | |
Re: Of course there will be some changes, but they should be minor. Except that, from other examples I've seen, most of your SQL statements will need to be rewritten. | |
Re: Change [inlinecode]mv $file "$file".das[/inlinecode] to [inlinecode]mv $file ${tmp}.das[/inlinecode]. It was just a typo. | |
Re: You're problem isn't, however, in updating the instance variable. m and n are getting updated just fine, with what you are doing. What is not working, is that the array is not dynamically changing size along with those variables. That is not the way it works. You need to redefine … | |
Re: Maybe the NullPointerException refers to "display". | |
Re: Do Your Own Homework. | |
| |
Re: Maybe you're looking for a splash screen. Check out this article: [url]http://www.javaworld.com/javaworld/javatips/jw-javatip104.html[/url] Edit: And that "give me the idea immediately" is extremely rude, whether prefixed with "please" or not. We are not here to serve you. | |
Re: Read up on JNI and/or the exec method of Runtime. | |
| |
Re: Read the JDBC tutorials at Sun, the JDBC documentation for the PostGreSQL Driver (once you download it), and the J2EE tutorial at Sun. | |
Re: tar keeps the directory path in place by default. This behaviour that your describing would be very unusual for a tar command. Something special is being done, probably an alias replacing tar with a special call (although I don't know of any options to tar that would cause this behaviour), … | |
Re: [QUOTE=kashko;320678]Define validate!!!! Define validate!!!! Define validate!!!! Assuming you mean verify it could be a valid IP address even if no one is using it, then you can do this with String Tokenizer or Stream Tokenizer String tokenizer splits the string into chunks using a delimiter. You will have to consider … | |
Re: You cannot store an integer value as an integer, and with a leading zero. I assume you only need the leading zero when printing the number, right? Than look into the format method for String, if you are using at least 1.5. (And follow the "format string" link found in … | |
Re: What?! No idea what you are asking. Please explain, in some detail, but without writing a novel, what it is you want to do. | |
| |
Re: This forum is about neither asp nor JavaScript. JavaScript != Java. Please find a forum dedicated to either asp and/or JavaScript and ask your question there. You will get much better results. | |
Re: No. You can obfuscate your code, or possibly try to create a native executable rather than a jarfile but both of these are equally useless. If someone wants your code they are going to get it. The only way you prevent them getting your code is to not distribute it. … | |
Re: Please explain what you expect to see as output, and what you are seeing as output, as well as what was provided as input. Also, post any exceptions you may be getting. | |
Re: And, of course, as mentioned in peter_budo's first post, that is JavaScript, not Java. Java != JavaScript. Find a JavaScript forum somewhere, rather than a Java Forum. | |
![]() | Re: Well this [quote] import java.awt.*; [/quote] is a pretty indicative tip. |
Re: Then what you are getting from your JOptionPane is a String. You need to convert this String to a char. Here is an example (I am assuming you only have to deal with one letter): [code] char letter = uppercaseString.toCharArray()[0]; [/code] I assume you know what to do with the … | |
Re: Because the path used will not function on a unix machine. The backslants will not work as a path on a unix machine and the double backslant at the beginning of the path also means absolutely nothing to a unix machine. To access a windows file from a unix machine … | |
Re: Even when you use odbc, from Java, you are using jdbc (it is called the jdbc-odbc bridge for a reason). And the advantage of using a real driver over the odbc one, is that the odbc driver is severly limited (and, if I remember right, not even thread safe, which … | |
Re: Check out the GridBagConstraints.anchor field. | |
Re: [url]http://java.sun.com/docs/books/tutorial/index.html[/url] | |
Re: Bad disguise of a homework question if, you ask me. So, do your own homework. As a hint, look at the man pages for the command sort. Then use a for loop, a counter variable, if, and echo (in that order). | |
![]() | |
Re: You should move it out to a Servlet, bean, custom JSTL tag, or other application context item. This type of code should never be found in a JSP. Other than that, yes it is possible. Try going through the following: [url]http://java.sun.com/j2ee/1.4/docs/tutorial/doc/[/url] (although it is one version outdated now) | |
Re: JavaScript to do it directly at the source or post the info in a submit to a servlet and let the servlet mail it using JavaMail. Here is something to get you started on the servlet side: [url]http://java.sun.com/j2ee/1.4/docs/tutorial/doc/[/url] And, no I am not going to give you the complete code … | |
Re: Sorry, misread. Checked Exceptions are exceptions that should be caught by your code. Unchecked Exceptions are exceptions that are based from RuntimeException and are not expected to be caught by your code. They indicate an unusal Runtime error/condition. | |
Re: It is frowned upon to place classes in the "main" or "default" or "unnamed" package. And this is one of the problems that arise from that. Place each of these classes into a package, then import package.Employee and everything will be okay. Also, if they are in the same package, … | |
Re: 100% 0 miles 251 secs. Got a little lucky, in that they didn't ask for Nebraska, Kansas, Tennessee, and the like until I had a state that should at least touch a corner of them so I had some reference on those. If those types of states come first, you … | |
Re: The only thing I can see, at a quick glance is on line 19. Take a close look at that [b]L[/b]ine. ![]() | |
Re: Well, your trying to match "Exit" and you entered "exit". It is case sensitive, you know. If that is truly the case try the following [code] while ( uc($command) ne "EXIT" ) { // instead of while ( $command ne "Exit" ) { [/code] | |
Re: Commuter Engineering. Does this mean that you sit beside the highway counting cars and attempting to think of a better way to get that many people through that area? ;-) Here are a few, but you should really think for yourself: Yahtzee Chat Chess Checkers All the other standard projects. | |
Re: No, you don't need to. Anything you print to System.out will show up in the catalina.out logfile (as long as you have that activated). | |
Re: That nobody ever reads the documentation and then attempt to solve their own problem anymore. I am truly getting sick and tired of the question "How do I deploy my application in blah blah blah?" RTFM, try it, then, if you have a problem, ask a specific question. Sheesh. | |
Re: No. You seem to be combining too manythings in too many places, and in improper manners at that. Rather than stating what technology you want to use to accomplish what, simply 1. describe what you currently have (in some detail) 2. describe what you want to achieve (in some detail) … | |
Re: simply go to java.sun.com, then to the downloads section for j2se/jse (however they are naming it now) and download the newest (the current link) or not more than one down from that. |
The End.