masijade 1,351 Industrious Poster Team Colleague Featured Poster

And there is no way to do it other than through the http access that everything else can do it with. So you need to do it with HttpURLConnection and parse those results.
What is so hard to understand about that? With Java, or any other language for that matter, you cannot see any part of a website that a normal user in front of a Browser can't see, and you can't see it in any other manner than they can see it (i.e. over HTML). What makes you think you could?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use HttpURLConnection (see the API docs) to connect, then use getInputStream and read that stream to get the data, and use an HTML Parser (Google for one, there are many) to get the links, then use an HttpURLConnection for each of those links, and the getInputStream to process each of those in a similar fashion, of course. Give it a try.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

HttpURLConnection and its getInputStream method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The line

JLabel label[] = new JLabel[ numLabels ];

creates an array of "numLabels" length containing references of the Type JLabel, but with value null. You still have to initiate the individual elements. I.E.

label[i] = new JLabel();
masijade 1,351 Industrious Poster Team Colleague Featured Poster

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.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

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.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

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.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

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

Statement s = conn.createStatement();
ResultSet rs = s.executeQuery("sql");
while (rs.next()) {
  s.executeUpdate("some other statement");
}

the rs.next() will throw that error on the first iteration after the reuse of the statement (i.e. in the second iteration).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This

ps.setString(1, newUser);<--------------------

is not your problem. This

ResultSet rs = ps.executeQuery();
        System.out.println("ResultSet rs= : "+rs.toString());
        String password = rs.getString(1);

is your problem. You have not called next() (or first()/last()/etc. for scrollable resultsets) before calling getString() so the current "cursor position" is before the first row, i.e. not yet on any row, hence the failure.

What was it you saw that made you think the PreparedStatement's setString was were the exception rather than the ResultSet's getString method?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because Strings are immutable. You cannot change it's content, you can only create a new String containing modified content, so

str.replace('x', 'k');

should, of course, be

str = str.replace('x', 'k');
masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, use next() and then toCharArray() and access the chars that way.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, read my post again, you will be using an array, but not creating or populating it in the manner in which you are "attempting" it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

But I've been told that in Java the base hash code of an Object is simply the memory address of the object

As has been implied already, someone told you wrong.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

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?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then I can only assume your on Windows, and the API docs for setFilenameFilter says

Filename filters do not function in Sun's reference implementation for Microsoft Windows.

Switch to JFileChooser, or live with it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

To do the addBatch simply do addBatch rather than execute and then include an if statement inside the for loop so that you can for, say, every 500 statements do executeBatch (i.e. if ((i % 500) == 0)). Also, as to why you only see one result, it is because you are only checking for one row. You are doing if(rs.next()) when you should be doing while(rs.next())

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, for one, I believe you meant

Carpark.setLayout(new GridLayout(3,2));

rather than just

setLayout(new GridLayout(3,2));

as that is the same as doing

this.setLayout(new GridLayout(3,2));

would would be useless since you do

this.setLayout(new BorderLayout());

right after that.

Also, you probably want to do

this.add(Carpark);

after doing

this.setLayout(new BorderLayout());

rather than before, and CENTER is the default in a BorderLayout, so that is where Carpark is after doing

this.setLayout(new BorderLayout());

which means that this line

this.add(Buttons,BorderLayout.CENTER);

covers it up. You probably want to do either

this.add(Buttons,BorderLayout.NORTH);

(or is that TOP, I don't remember, off-the-top-of-my-head, see the API docs) or

this.add(Buttons,BorderLayout.SOUTH);

(or is that BOTTOM, I dont remember, off--the-top-of-my-head, see the API docs).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry about that. That was a MySQL Connection URL property "allowMultiQueries".

From what I saw of your thread, you would be better off using Stement and the addBatch(String) method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

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 quick look at the API docs should have pointed this out, FileDialog only has about 10 methods). Simply have the "accept" method return true for filenames ending with "mp3" as a simple explanation. Try it, and post your attempt if you can't get it to work.

I do, however, need to ask why you wish to use the awt FileDialog rather than the Swing JFileChooser. I hope you're not mixing awt and swing elements.

Illidanek commented: Helpful and on-topic +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

I don't know how that won't just make things worse.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Something in there is null. Add a printstacktrace to that catch block so you can at least identify which line it's happening on.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show the code for this part. Are you trying to execute multiple statements with a single sql string? If so, have you activated the "allow multiple statements" property?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Your problem (if the queries really look like what you've presented there) is the single quotes (') around the table names. Remove those. If you're worried that the tablename might be "generally" invalid, thereby needing to be quoted, then use double quotes (") not single quotes.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well the api docs say

Executes the given SQL statement, which returns a single ResultSet object.

for executeQuery and

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

for executeUpdate

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nevermind, I am not going to get into an argument over "half-knowledge" and spoonfeeding.

Edit: Especially in a thread that is over two years dead. And by "not going to into detail" I assume you mean that I ddin't spoonfeed code. I wanted to see his code, first. It was, after all, his job to do, not mine.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is not "converting" an InputStream to anything. That is reading an inputstream and storing (rather inefficiently) all of the read bytes into an array. Better would be to read it, and write it to a ByteArrayOutputStream and then simply get the bytes from that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why are you making a length 7 int array and then reading a single int and attempting to assign it to an undefined array element (at that point i is undefined).

Read the input as a single int (into it's own int varaible, not an array), to make sure that it is an int, then use String.valueOf(int).toCharArray() to get the character array (i.e. one array character element per digit in the number), then run through your loop with that char array, rather than an int array.

Edit: Now, take that info and at least try something. And, when you post here, then you tell us exactly what you're doing wrong. As of yet, you have not, even once, hinted at what kind of problems you're getting. Compiler messages, exceptions, simply unexpected or missing output. Nothing. How are we to help you solve your problem when we don't know what that problem is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Start your own thread rather than ressurecting zombies. And read the API docs, as already pointed out, as well as looking at the tutorials, as well as googling for a few examples (i.e. add the word "example" to your Google search) before you go begging for scraps on a forum. At least make it look like your trying.

Closing this thread now.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

then try adding ";create=true" to the end of the dburl. See the documentation (as I believe I've already said). Its not "entering that method" as you say because the connection is failing (possibly becuase the db doesn't exist, which I assume is the case since you're wanting to create tables), and you would be able to "see" that if you didn't simply ignore the exceptions like you are. Never do that. At the very least print the stack traces to STDERR.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Perl was once widely described as "the duct tape that holds the internet together"... that's not the case anymore.

And that statement shows just how "unfit" it was for the task (after all, even though it sometims works, duct tape is never the answer). Then again, everything was at that time. I don't think anyone ever believed that Perl was going to hold strong in that area. It was destined to become "outdated" for the task, even if it had only taken 2 years for 6 to come out. As I have already said, simple shell scripts were just as good (and just as widely used) as Perl for CGI purposes, and that's not a good sign.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I have also used perl widely in a wide variety of tasks, but I don't believe 6 will ever come out. Or, at least, I'll believe it when I see it. The language is far from dead, but it is also far from mainstream. That happens to all languages, eventually, and the reasons for it are always varied. All I can say is, don't sit on one language and expect to "make your bread" with it your entire life. You need to continually change to survive in this industry.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And I just pointed out that, IMHO, that was irrelevant.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, create=true as part of the DB url, maybe? Can't say if that's case since you haven't shown us what you used, nor told us in what state the DB was in before you started.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As a text input type? See the tutorials.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Perl is not only for websites. In fact, that is the least that it's meant for, so all of that means, essentially, nothing. In fact, its not meant for that, at all, not anymore than simple shell scripts are (which function just as well for CGI). Sure, there's a few modules for it, but it is still far from its intended purpose. I'm sorry, but its true.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, post what you have so far, we are not simply going to do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What problem? What is the complete compiler message?

P.S. That should be using Generics.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Need Help with Comparable/Comparator.

Good for you. I, however, have no idea what that needed help might be, since you didn't say/ask.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the API docs. You can add another argument to your FileWriter constructor call so that it appends rather than overwrites.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

JLabels can take HTML style text so simply use "<BR>".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sounds like a question for the producers of your IDE, as that is not a Java error.

However, do you want an Applet or a Stand-alone app?

You've extended Applet, but written a Stand-Alone, so which is it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make an arraylist with all the individual items.

Generate a random number (not larger than the current size of the arraylist) and get then remove that index from the arraylist. Repeat.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I have no idea what you mean with "be catch from my program". If you mean you want to snoop network traffic then Google "JPCap"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As to how to connect to and use a DB in Java see the tutorials.

Then use the JDBC-ODBC Bridge to use Access and make sure to either properly configure an ODBC DSN (that is a Micrososft question) or use a DSNless connection (Google both "JDBC-ODBC Bridge" and "DSNless connection").

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why resurrect a zombie to inadequately answer an already adequately answered question?

Closing this thread.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Of course, if you don't want to make the three checks on the if line, simply write a method

boolean exists(Object[] array, int index1, int index2) {
    return ((array.length >= 100) && (array[99].length >= 100) && (array[99][99] != null)/* && (add whatever additional condition you want)*/);
}

and call it instead

if (exists(array, 99, 99)) {
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Either wrap the stuff in a try catch block, or simply check the lengths of the arrays. I.E. if checking whether array[99][99] exists (and is a valid object and not null) simply do

if ((array.length >= 100) && (array[99].length >= 100) && (array[99][99] != null))
masijade 1,351 Industrious Poster Team Colleague Featured Poster

You have one too many close parens on the abs call.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A Date object always stores the date in UTC. When you then display that date (such as with toString) then the date/time will be displayed in the systems default timezone. If you wish to display it in a different timezone, or import a string as a date as if it were from a different timezone, then see the API docs for SimpleDateFormat, its parse and format methods, and its setTimezone method. Remember, however, that the Date object itself is always in UTC and only when you produce a String representation of that Date, does the timezone "influence" take place, and then only in that String representation.