masijade 1,351 Industrious Poster Team Colleague Featured Poster

By using the web container's connection pool and JNDI.

See your web containers documentation and the JEE Tutorials.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you are getting an exception on one of those set lines that you are seemingly ignoring or you would have provided the exeption.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That parse method is giving you a java.util.Date object, you need a java.sql.Date object in the setDate method. See the Date(long) constructor of java.sql.Date and the getTime() method of java.util.Date and use the latter as the argument in the former to get a java.sql.Date instance.

Edit: P.S. it would have helped to know the exception you were getting.

Edit Again: It is also not normal to surround the schema, table, and column names with single quotes ( ' ), although you might surround them with double quotes ( " ) if they also represent reserved words in the db.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

I've already told you that until it compiles there is nothing to execute.

And, as far as being new goes, then you need to start with something simpler, such as the official tutorials.

stultuske commented: hear yeh, hear yeh .. +10
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Correct, the number of items in a list is one greater than the last index in the list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

loop backwards, currently once you do removeRow(0) the former row 1 becomes row 0, then when you doe removeRow(1) (really row 2 now) the original row 3 becomes row 1, etc, etc.

mKorbel commented: that right +1 +8
masijade 1,351 Industrious Poster Team Colleague Featured Poster

It is strange that eclipse doesn't find any code to execute. How do you think I can possibly fix the issue?

You said that Eclipse "shows errors". Well, how do you propose that Eclipse execute anything that isn't compiled? This is not a scripting language, you know. As I said, fix those errors.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

@ Masijade, These packages and projects are from a book. Therefore, they are not written for readers to complete them; they're meant to help readers understand how an app works and play around with the code.

Okay? And? How does that change anything I said? If it doesn't compile it is not a main class. It is an attempt at a main class, but until it compiles there is nothing for Eclipse to execute.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if Eclipse "shows that there are errors and warnings" then that class is probably not being compiled and so the project does not contain an executable main class. Fix the "errors and warnings", first.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A long idle time between uses of the statement maybe? If that's case check out the session/connection timeout settings and the like for your db. Otherwise, simply catch the exception, check for this message (or, actually, the error code) and recreate the PreparedStatement.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, by going to the project menu, choosing properties, then going to the library tab and adding the jar?

Or going to the run menu, choosing run configurations, choosing the "task" for the class, choosing the classpath tab, and adding it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You need to add it to the classpath in the run configurations, or as a library in the project properties. The "build path" is only for compiling, and for that you don't the MySQL driver.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I don't see (off hand) your problem, but I do have a suggestion, if you turn your if statement around, then you only have to check one condition each time (rather than two), i.e.

if (whatever >= 90) {
    // A
} else if (whatever >= 80) {
    // B
...
} else {
    // F
}

Edit: I would also strongly suggest passing the already created Scanner object to the method rather than wrapping System.in with yet another one.

Edit Again: I would, however, say to move the "studCount++" outside of the inner for loop, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And what is wrong with INFO messages?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Emp is probably a reserved word. Try surrounding the name in quotes or brackets (since this is an MS produced DB it might use the Access quoting process, hence the brackets).

I.E.

"SELECT * FROM \"Emp\""
// or
"SELECT * FROM [Emp]"
masijade 1,351 Industrious Poster Team Colleague Featured Poster

I think you are not using the master or the default password that is "adminadmin" .

Truth be told, I would expect a different error than "not supported" in that case.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Upgrade your netbeans?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does your HTML look like? Are you using the Applet tag (which you shouldn't), or the Object tag (which is better, but still not right) or JNLP?

See this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you have not "included it on your classpath" properly. How did you "include it on your classpath" and how, exactly are you executing this code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the first thread in this forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What database are you using? If it is not Access then use the JDBC Driver meant for that DB, not the JDBC-ODBC bridge, and if you are using Access, then use a different db.

And, if you want to know what the problem is, then don't hide it behind your own meaningless error statement. Add a printstacktrace call to that catch block.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show how you instantiated it. As an instance or a class variable?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you cannot call non-static methods from a static context without using an instance of the class containing those methods. i.e.

Whatever variable = new Whatever();
variable.someMethod();
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Post the actual stack trace. And I hope the class containing this call does not import a class named "File" (or that its package does not contain a class named "File") that is different from the "File" imported in DirLocator (or from a class named File in its package).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

6 % 2 = 0
So, if I have a remainder of 0 and a divisor of 2, what did I start with?
Well, that would be; 2, or 4, or 6, or 8, or... (DO YOU SEE A PATTERN HERE?)
There is no answer here.
There is no way to do a reversal of the mod (%) function.

Correct, and, OP, that is what

funtions dat arent 1 to 1 dnt hv inverses.

means. I.E. modulo returns the same "answer" for multiple inputs, using the same modulo factor, so there is a "one to many" relationship and so is impossible to determine which of the "many" was used to produce the "one".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the API docs. When you do new ObjectInputStream(InputStream) it will attempt to read the "header" object created by on the other end when doing new ObjectOutputStream(OutputStream), and that read call blocks until it gets something. You need to create the ObjectOutputStream before creating the ObjectInputStream or design the thing in such a way (i.e. in a thread or something) that it doesn't matter that the creation of ObjectInputStream blocks until it gets the "header".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By creating another class, of course. A simple class with two instance fields. and if you don't feel like making the setter/getter methods and/or a special constructor simply make the fields public.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Creating a new ObjectOutputStream around an OutputStream will cause a new "header" object to be created and written to the Stream, which you do not want to do more than once (unless you are also creating a new ObjectInputStream on the other end with every "read", both of these is which an extreme waste of effort and bandwidth).

Create an Object to hold both a Socket and an ObjectOutputStream and add these objects to your hashtable rather than the socket.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

try "man gcc" or google for gcc documentation.

vedro-compota commented: ++++++++ +3
masijade 1,351 Industrious Poster Team Colleague Featured Poster

but I gave them unlocked *.mdb file

It already belonged to them, and if you hadn't have given it to them, and they decided they needed it they could have come after you legally.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

@ not at all, some InHouseAppS have long, long story :-)

Yes, all. If a company contracts someone to write code for them, or someone writes (or even just tests) some code on that companys computers, that code belongs to the company. The only way it does not is if the company wrote a specfic contract in that manner, in which case they hopefully contracted for support, and if not, they need to throw it out as it is nothing but a dead weight for them and they were fools for doing it that way.

Edit: And, p.s., if it is a program that got into the company in any other way (i.e. someone wrote it at home and simply brought it to work and started using it) then the company still needs to throw it out as a security risk (and possibly/probably prosecute/discipline the employee) or the employee needs to start a process of getting it verified/certified with the company, which would then, probably, also require a support agreement, again.

Edit Again: At least this is the way in which most company employment contracts and/or computer use restriction documents are written.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. Anything you do will be a crutch and/or workaround. If "this person" wrote the code for this company (i.e. the company paid them to do it or they did while working for the company, even if in some other form) then the source code belongs to the company and they should have it somewhere, if they do not have it, but should, then find the guy and get it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So, the person who wrote is not there. And? Does that mean you don't have the source code either? The "solution" is, of course, to simply add it to the original code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It might help to see the full error and the code, you know?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See JDialog instead of JFrame.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Edit: Nevermind. I completely misread.

Edit Again: Include a read me in your distribution giving instructions to the user in case of problems. I.E. this is a user problem and you should provide support, but don't expect to be able to solve every environment related issue programatically.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You don't add the group as a single entity you add each of the buttons to the group and wherever it is to be displayed. The group simply ensures that only one of those radios are selected at any one time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You haven't added the button group to anything.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Those items are created locally in other methods meaning they are not available within another method. It lloks as though you want to use instance variables rather than local variables.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The same way you would in any SQL compliant db, with SQL. Google for an SQL tutorial/reference site, there are plenty out there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
String bogus = year + month + date
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Seeing as how a ".bak" is normally a backup copy of some already existing file, I would say read the original and write the new or look at the API docs for FileChannel, I believe there is actually a "copy" method there (if I'm remembering correctly).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why do you want "JSP coding", when you're currently using Java coding? Don't tell me you used a scriplet to get those values. Don't tell me that you don't know about ${param.xxx} JSP syntax. Why does everybody dive immediately into JSP and never look at the tutorials?

The J2EE(TM) 1.4 Tutorial
- The Java EE 5 Tutorial
- The Java EE 6 Tutorial

And as far as "concatenating" the values simply "output" them one after the other.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Just put the page back to the "right" place and change this "servlet" to a filter and apply the filter to the url for that page.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm I would comment out the "throw" statements in the mouse listener interface methods, again. Not that that, necessarily, is your problem, but ....

cwarn23 commented: Thankyou for the great advice :) +6
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well that is what the original from google gave me.
http://www.exampledepot.com/egs/java.net/GetImage.html

because those are simple examples and, simple examples are notoriously famous for leaving out all forms of error handling.

So I'm not sure what is meant to be in those catch blocks because the sample code had empty catch blocks and I'm not the greatest Java programmer.

Simply add a printStackTrace as follows:
before

} catch (Exception e) {}

after

} catch (Exception e) { e.printStackTrace(); }

and then look at the Java Console (you can access that from the browser menus), and not the use of the variable in that call, it is the same, of course, as that declared in the declaration of the catch block.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, stop ignoring Exceptions (see all of your empty catch blocks) and you just might figure out what the problem is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Huh? Try again. Doing that would, of course, lead to an "else without if" compiler message. Please, don't guess, or at least try your guesses before posting them.

Edit: Damn! Too slow, again!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So it gives you an error? And? How did you determine that this sort method had anything to do with it, or are you just guessing? Print the stacktrace of the error and read it. It will tell you exactly where the problem is. If you find yourself incapable of zeroeing in on the problem this way, then post the full stack trace here and more code, that little snippet above tells us nothing.