masijade 1,351 Industrious Poster Team Colleague Featured Poster

call the "cal" command twice?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is this a jsp or a servlet, as you are using jsp scriptlet tags, but seemingly inside another scriplet block, or inside a servlet. Neither of which, of course, works. If a servlet, use PreparedStatement and its setWhatever method with that getParameter call (transforming it to the proper type, of course). If a JSP (and you insist on doing this sort of action in a JSP, whic I know you will then, they always do) then use the JSTL sql tag package and its implementation PreparedStatement. BTW, a scriptlet to retreive a request property is not necessary in a JSP

${param.id}

(param is "hard-coded" and the part after the "." is the parameter name, of course)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Right, I believe however that simply using -lt instead of <= also works as expected.

Although I must say i did not know about {x .. y}, you learn something new everyday.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay. Thats something different. Now, what are you trying to do? If you don't want the resulting DB entry to have newlines, that is something completely different from "escaping special characters". "Escaping special characters" in a db context means making it so that the data will be inserted into the DB without some extra sql action taking place due to the content of the string (including simply causing a syntax error). So, what do you want? If you want to remove newlines and the such, then remove them, use something like replace("\\n", "") If you want some generic method that removes all "special" characters (newline, etc), no there isn't one, AFAIK.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How is that the "wrong" format? \n is newline so you have two newlines in that string and that is exactly what you see in the db so what's wrong?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh:

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The PreparedStatement does that automatically when you use setString. I believe I just hinted at that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you are using preparedstatement properly you are already preventing sql injection.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The "top left to bottom right" is row == col
The "top right" to bottom left" is (row + col + 1) == 4

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm something like

//pseudo code
if (prod) {
  // display prod items
}
// display non-prod items

IOW always display the "non-prod" items and only display the "prod" items if that option is selected.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You don't know anything about the basics (not even the classpath) and you immediately dive into some advanced integration library?

Download their library and add it to your classpath, then google for some examples and get to work. I have never used the thing myself, so tell you anything about I would have to Google it myself, which is doing your work for you (some of which I have already done giving you there homepage and the google search needed to find examples).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well I'm not going to do your work for you. See the API docs, try some things out and google.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

jsp is a servlet that runs on the server and produces output (usually an html page). JavaScript (and it is one word, and has nothing to do with java) runs on the client in the browser after the server has delivered it. There is no reason that what the jsp produces can't include javascript or a reference to a js file. IOW, the two have nothing to do with each other.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

instance and/or class variables and they are used for what all variables are used for, storing values.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The description says, however "removing indices greater or equal to s".

Also, start from the end of the list and move forwards. When you start from the "front" (or from the index to remove) the following happens.

List -> 1 2 3 4 5 6 7 8 9 0
Remove index 4 (the 5) and increment the index to 5
List -> 1 2 3 4 6 7 8 9 0
Remove index 5 (now the 7) and increment the inde to 6
List -> 1 2 3 4 6 8 9 0
Remove index 6 (now the 9) and increment the index to 7
List -> 1 2 3 4 6 8 0
End because the index is beyond the end.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First why "s-1"? Second, what is wrong with what you've tried? IOW what exceptions are you getting or what is happening that should not be happening or what is not happening that should be happening?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, lets see what you've tried. But really, all you need to do loop from the end of list forwards until you reach the provided index.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I should think their homepage could help you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

call repaint and/or revalidate on the componentPane after calling setVisible.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

P.S. Just so you know, I find nothing wrong with your "solution". What I took issue with was your "high-handedness" passing it out based on assumption. Had you simply said "if that posted example is exactly what the result should look like ..." rather than essentially saying "your all idiots" I would not only have not taken issue with it, I would have supported it. But no, you come here, make an assumption, and then, using that assumption you attempt to browbeat everyone else (some of them very good people) into line with your thinking. Sorry, that doesn't fly. I simply pointed out to you that it was an assumption and that the posted example might not be exactly representative of what the OP really needs and outlined the reasons for that. There wasn't even anything confrontational about the post, but you seemingly took it so.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That statement reads as follows

= %'A'

you wanted

= 'A%'

correct?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

how can i get java to enter/type text into a textbox for me once i select it(click inside it) so the cursor is there. Also how would i get it to send the enter key or other "non-text" keys.

If you want your program to automatically insert text into its Swing/AWT/Whatever Gui then, yes, use a focuslistener then simply use setText (or, if you wish to have one character at a time appear, setText in a loop with a short sleep, just make sure you don't do that on the event thread). If you are talking about having a Java Program insert text into some other program's GUI (such as a website which it sounds like what you are asking), probably not, at least not "easily", and probably not without some sort of native library and JNI. Another possibility for entering into it's own program is to use the Robot class (that will allow it to act as though there were a person sitting there and using the GUI, not just enter text in the text field) Obviously usually only useful for "demos" and/or Games (as a second player, etc).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No was flaming until you did. Once again go by what the poster says, until he actually says that he needs a String array and needs it capitalised then you are the one assuming that it does. But to settle your fears

str.toUpperCase().split("(?<=.)")

Not that it was really necessary, since I only posted the modification to the "split" that you had used yourself, so the reposting the toUpperCase was not needed and your mentioning it was pedantic.

Satisfied? No. Because you are incapable of admitting you may have been wrong, either in a technical sense or a social sense.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

2) If you're mapping custom objects, you'll want to look into hashcodes. There's a lot of talk out there about good hash codes, so there's a lot of reading to do. Have fun.

Not to forget the equals method, of course. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A repair shop. It is possible to get the BIOS updated (if that's what it is). I have no idea what it is you're actually seeing (and you seemingly don't either, not really), so let a "professional" look at it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then a format won't help as the virus resides in the BIOS. Take it to a shop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So boot from cd/dvd and format your drives from there. A virus can't "interfere" with that unless it's a "BIOS" virus in which case you're screwed anyway.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go to BIOS (either F2, enter, space, F1 or something similar at the very beginning of the boot process) and make sure that the cd/dvd is the first item in the boot order.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then set your boot order properly and try again.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

boot from cd.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Masijade -- I don't see how your assumptions contribute to this thread. None of the previous posts result in:

{ "P", "H", "I", "L", "L", "I", "P" }

And you obviously did not read this part of the post

And just because what he posted was a String array neither means that he wants or needs a String array.

Like I said, what he said was "array" not "String array". The only one making assumptions and attempting to lambast others with this "attention to details" high handedness was you.

Edit: And, if it is acceptable, always go for the simplest solution first, which, in this case, is probably toCharArray().

Edit Again: Besides the fact that you can get a String[] using split without that leading blank. It is, after all, regular expression.

split("(?<=.)")
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Thanks for the suggestion and here is my updated version:

And what I meant, of course, was the entire String concatenation that you are still doing. Simply changing to PreparedStatement and using it as a normal Statement (which is possible) defeats the purpose, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

are i need a code dear....which fulfill this application... i need a code in core java..plzzzzzz

No. We do not give out code here. It is your homework, do it. Post your code here and we will help you correct it, but we will not do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is why I said Object array. And int will autobox to an Integer when added to an Object[] index. Likewise with Long, Double, etc, and, obviously, you can Store Date, Timestamp, etc, in an Object[] array as well.

For the second issue, if you mean you have to populate column one in all rows, then column 2 in all rows, then you probably have a design problem. If you mean you have to populate an entire row at once, well, that is what you get from a result set anyway, and exactly what a List<Object[]> (which is what I suggested) also gives you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

ex.printStackTrace() is better, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

They have to be connected through a network. Whether that network is a "cable" network, or a "wireless" network is irrelevant. "cable" is not what is meant by "physically". "Physically", in that statement, means that an actual network connection exists, but it must be a "real", standard network connection.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not with pure Java, no. The ad-hoc network will already have to exist and then you can use it to connect from one to the other, yes.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Finished.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I didn't know java had swings. It is kind of hard for an abstract computer language to have playground equipment. It is called Swing and saying "swings" makes you sound like an idiot (not saying you are but saying that makes you sound like it).

Now, please explain what you mean by "dynamic textfields".

If you mean adding one after an action event, well add it and then call revalidate() and/or repaint() on the container you added it to (both is best).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Although this gives a char array; the OP is looking for an array of Strings.

Not necessarily. He said "array" not String array. And just because what he posted was a String array neither means that he wants or needs a String array. The OP may simply not no how to "hard-code" a char array, or may not realise that a char array is sufficient for the "problem". This question is obviously a "beginner" question so both of those are easily possibilities.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This sort of thing

String sqlUpdate = "UPDATE Staff (id,lastName,firstName, mi, address,"
+ " city,state,telephone, email) SET ( '" + jtfID.getText().trim()
+ "','" + jtfLastName.getText().trim() + "','" + jtfFirstName.getText().trim()
+ "', '" + jtfID.getText().trim() + "', '" + jtfAddress.getText().trim()
+ "', '" + jtfCity.getText().trim() + "', '" + jtfTelephone.getText().trim()
+ "', '" + jtfEmail.getText().trim() + "')";

is your biggest problem.
Use PreparedStatement unless you want sporadic SQL syntax exceptions or SQL Injection attacks. (or learn how to properly escape anything that might be entered into those textfields yourself and do that, and it's not really worth the effort since the JDBC driver developers have already done it)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well see, how does "how do I display x num components after an event" relate to "Can you group textboxes?" ?

Create a JPanel that is to hold these "textboxes" and place it on the GUI at the beginning.
Write a selection listener, and add it to the listbox, that then removes all components from that Panel and adds the "proper number" of text boxes to it, then calls validate() and/or repaint() on that panel.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In what way? Ina display, of course, simply place them next to each other. In a "query" aspect? No. Give them all "names" that start the same, maybe?

Edit: Or just simply to have a handy "list" that contains them all? Yes, just use a List or array.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

create an object array of the same length as the resultset has columns and then get... into the array indexes (the array index is, of course, one less than resultset index) and then add that array to the list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, something on that line is null, even if it weren't that loop would eventually lead to an indexOutOfBoundsException since your for loop condition is corked. Either strSub is null, or properties is null (kind of doubt this one as it was used before the previous loop).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, you need to first define what it is you need help with as I have no idea what you are talking about. What does a "-3 byte array" have to do with "FileHandling" and what is a "2-3 byte array" in your definition in the first place. If you Google as well as you ask here I can believe you are not finding anything that helps.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

For one, your if statement should be && not ||
As it is now, if it is null it attempts to do equalsIgnoreCase on that nuill reference.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google for an HTMLParser, then use that to parse the page, and then retrieve the links from that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

keySet to get the keys as a set, then iterate that.

Edit: Not that "next" and "previous" have any real meaning in a HashMap.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Write a proper class, not a bad hack at a serial program. IOW don't just put everything in main, and catch and handle (when possible) exceptions, don't just declare "throws Exception". The very least you should do is give out a proper error message rather than just dropping out.