masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sun's (Oracle's really) JVM, for the most part, yes, but it doesn't have to be. The language used to create the JVM is completely irrelevant as long as it is able to execute the byte code in the class files in the proscribed manner. And the compiler is written in Java, BTW, and uses the JVM.

Edit: P.S., when using an IDE you are, normally, not using the compiler provided by the JDK (whether Oracle's, IBM's, or the OpenSource Community's, or any other that may exist), you are, then, using the compiler that the IDE provides.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if you don't declare the method synched, its not synched. But, if you meant, you can control which portions of the method are synched, yes. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

At the simplest, yes, simply make the methods synchronised as that will cause them to sync on the instance of the class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

With that as your starting point? Not at all. And see your other thread.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, why are overwriting the value each iteration (rather than using +=), why are you formatting the same data every time (rather than using getTime, in that spot, directly), and why haven't you written a main method, yet (we are not going to do it for you)?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ahh, its good to feel that breath of fresh air again.

How ya doing? Until recently, I haven't seen ya around (here) for a while, and I've not dived into the Oracle Java forums much.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Include the javamail jarfile on your classpath.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
f.getParentFile().mkdirs();

The api docs work wonders, if you actually look at them.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Killing this zombie now.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You are making things far more complicated than they need to be. Date (and Timestamp) will always display the date in the local timezone, regardless of what timezone you used to parse the data, so "1" is not only possible, it is the default, and "2" (if really just needs the millisecond difference) is simply subtracting a getTime() call on that Date object from System.currentTimeMillis().

masijade 1,351 Industrious Poster Team Colleague Featured Poster

SimpleDateFormat with the TimeZone set to GMT, to parse the date, then simply display the date (without using the DateFormat object, or using a different one where you have not specifically set a TimeZone).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And your problem is ...?

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

If you use that statement, what? The machine blows up?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use the array version of the exec method. See the API docs.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, in your web.xml I see you servlet tags, but not you servlet mappings

<servlet>
        <servlet-name>SomeServletMapping</servlet-name>
        <servlet-class>some.package.SomeClass</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>SomeServletMapping</servlet-name>
        <url-pattern>/some/page/url</url-pattern><!--does not include application name (i.e. servletexam in your case)-->
    </servlet-mapping>
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Are you maybe ignoring compiler messages? Because your "SecondThread" class has all sorts of "Unhandled Exception IOException" errors, so it never gets compiled, so the method is "undefined" when trying to compile the other class since "SecondThread" is never fully defined, since it hasn't, and can't, compile.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And that still tells me next to nothing. Lets see some of your actual code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, authenticate?

Edit: See this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, show us your code, maybe? Or at least give a much more detailed description than "implemented in a resultset".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use the Oracle JDBC Driver not the JDBC-ODBC Bridge.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

JOptionPane for a "GUI" (Scanner for a "console") program. See the API docs for those classes and google for some tutorials.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because he configured it that way, of course. ;-)

@OP P.S. if your "main" class is called "firstgui" your properties/preferences should designate "firstgui" not Main.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Java is case-sensitive.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Set the main class in the project properties/preferences.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That url is a DSNLess connection url, an ODBC DSN entry is not necessary.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You would have to place the "mdb" on a shared drive and provide the path to that shared drive/mdb.

Access is not a "remote access" capable DB. It is a file-based DB. If a machine cannot directly access the mdb file, they cannot access the Acess DB, and two people cannot access it with write access simultaneously.

Edit: If you mean that you are deploying both the app and the DB and simply want to be able to configure the "string" for the path to the url, then use a string var in that position and populate that string using Properties.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And it obviously has nothing to do with the classpath (I never said, or even hinted that it did) or you would be getting a ClassNotFoundException, of course.

See that link.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nevermind that. See the link anyway.

See this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can try getting it from the UserAgent (google that), but many times that is not provided (due to varying user security settings). You can try planting some JavaScript onto one page and posting that info to the next link, but security settings may prevent this, as well. IOW, that is one of the things that is, many times, hidden.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Where are the package statements in those servlets? And where, under WEB_INF/classes are they located, exactly.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the man pages for the find command.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And the rest of my suggestion? I am not going to "finish" your code, if that's what you think. At least try to implement some of the methods, the constructors, at least.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Find someone that can physically sit with you and explain how web containers work.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, the JDBC Driver for the DB you're using? And, yes, the type 4 driver is best.

As far as where to put it, if you are using an IDE then see it's documentation, if not then use the -cp command line option, or properly configure the class-path attirbute in the manifest file of the jarfile if using the -jar option.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Are you trying to learn JavaScript, or Java, because judging by

I'd like to put this code in a template that all like page will use.

it looks like you really want JavaScript as Java has nothing to do with "pages". And please respond as if it is JavaScript you want I will move your post to the proper forum (not that this code will apply there, either, but at least you might get some good suggestions as to where to start).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I thought you said you'd post what you had. Unfortunately for you all I see is the assignment text. Where is your code? You should, at least, be able to create class shells with empty methods and vars for the described attributes, right? Start with that, then start filling those methods in, just do one at a time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Don't do this with a JSP, do not use scriptlets, at all, in a JSP when it can be avoided, which it almost always can be, use a Servlet. You can use a JSP to create the form, but the post request should be going to a servlet (the servlet can always forward to a JSP to create some response or other, but the actual upload should be done by a Servlet). Once you have refactored your code to that, and tested it, and it still doesn't work, then post that here. I, for one, am not even going to attempt to read all of those scriptlets. That is one reason to not use scriptlets in JSP, they do not scale easily and they are a maintenance nightmare!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See HttpUrlConnection.

Edit: I assume you know how to enter a url into a browser so the formation of the url itself should not be the problem.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can place primitives into collections due to autoboxing, where the primitive will be automatically converted into it's respective object, and when the Generics are set up properly it can be autounboxed (automatically converted back to it's primitive) without any casting. That has nothing to do with whether the primitives are objects though. And we are talking about the programming, not the execution, so even if primitives are internally represented as objects, during the programming they are not.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

but dear if i handle this exception then also no matters now it will give me run time error.....

So what, you still need to add the catch block (or the throws clause) or your program won't even compile and that will make it a bit hard to run. If you then get a runtime exception, then you either typed the class/package name wrong, or you do not have the JDBC driver on your classpath (you know about that, don't you?).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i know how to handle exception ok....

Seemingly not if you are asking how to solve that compiler message.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry, if you don't, yet know how to handle exceptions you should not be attempting JDBC, yet. See this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i dont know wat codes to be use! cause our professor just gave us that output and didnt teach us how to program that LIBRARY SYSTEM.. =( now where having some trouble in doing this project because all of my classmates are still newbie in programming...

Of course he did. He didn't say "this is your project and this is how you code form1 and this is how you code form2, etc, etc" because then he would be doing the project and not you. I can guarantee however, that the material needed to do this was either taught in that class or was a prerequisite to taking that class. If the former, you should have paid attention, and if the latter you shouldn't have lied about your qualifications.

As far as "how to write it", see the tutorials and go through all of them as you seemingly need to start from the beginning.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A "JSP" does not run "standalone". Install a tomcat (or some other web container) on that "other machine" and deploy the web application to that web container then use a standard http request (i.e. browser view) to "execute" it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

One thing puzzles me though; why do you NEED a FULL explanation?

Because he was asked (at least something like) that as part of a test or interview, of course. Give me teh codez.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Find (or invent) a definition for "Purely object oriented language" (there is no official, (e.g. IEEE) definition for it BTW), then think about whether anything about the language doesn't fit that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The same way you do in HTML, since all a JSP (or actually a Servlet judging by what you posted) does is produce HTML (not that you "call" css, at all, you reference it). Of course you have to escape the quotes that appear within the quotes.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

yep...its a note..i dont know what to do.. T.T
im just a student

Recompile with the option that that message tells you to.

It has to do with Generics.

And you do realise that the program did compile, right? That is just a note, it does not keep your program from compiling, it does, however, prevent the compiler from guaranteeing type safety.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

that would just print out the curretn month twice?

When called with no arguments yes, but the command does take arguments.