masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you need to explain better exactly what it is you are trying to accomplish. "I need the data from 12 tables" doesn't really tell us anything, and there is no reason why we should have to study your code to puzzle out and guess at what it is you are trying to do, when you could simply tell us.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
select table1.field1, table1.field2, table2.field1
from table1, table2
where table1.field3 = table2.field5

Again, this is an SQL question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because, like I said, a "join" in the where clause of your SQL query is a much better way to do it (you only need one query), and the construction of that query (as it is an SQL query) is an SQL question and not a Java question.

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

By adding more queries?

If you mean you have "12" "mdb" files to read, then open 12 connections. If you mean you have to read information from multiple tables within the same "mdb" file, then add additional queries for them. If you need the data from all the tables combined in a single query, then you need to use "join" and that is an SQL and not a Java question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i am java fresher a have good logic skill still i want to improve any guidence

This post, in this thread, is not, exactly, an endorsement of your claim of having "good logic skill".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Can someone give me a code for this? ...

Yes. I won't though. Read the terms and conditions of this site, again, please. You have read them at least once, already, right?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why the map? Why not just test the button to see if it's checked?

Assuming there are (or may be) multiple buttons and multiple radio buttons. Why have fifteen anonymous listener classes when a single instance would be more than enough?

Or, why have fifteen if statements when a single map lookup would handle it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster
actionPerformed
  if (source == button)
    // if a hashmap
    radio = map.get(button)
    // if a new object
    radio = button.radio

  if (radio.isSelected())

I assume you know how to create a map? I assume you know how to use the "extends" keyword.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Don't associate an action event with the radio button, but, rather, just with the jbutton, then have the listener simply check the value of the radio button. You will probably have to build up a map with the button->radio associations (or make your own "extneds JButton" class where you can store a reference to the radio button directly), however.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

My cousin Joe is the one responsible for making sure no one steals my file folders. He's my "folder watcher", but he's a little big to be called "mini". Should I hire him out to you anyway?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

i didnt ask for whole solution. i only asked suggestion...

And hoped for a complete cut-n-paste ready solution, as does everyone that is not willing to think about things themselves, and so simply post complete assignment texts on a forum.

That statement does not convince me of your honesty or intent. If you really wanted a suggestion and not an at least partial solution, then you should have also stated your thoughts about how you might go about it and/or anything you've written so far in order to show your own efforts and willingness to work.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

FYI, if x is 0 then x % 2 is also 0. The second check is worthless.

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

Okay? So what do you have so far, and what problems is it giving you? We are not going to do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As in the response to your hijack post in the other thread

$ENV{PATH}
masijade 1,351 Industrious Poster Team Colleague Featured Poster
$ENV{PATH}
masijade 1,351 Industrious Poster Team Colleague Featured Poster

thank you very much
but what Id or name, this is my menu selection:

<select>
<option value ="sydney">Sydney</option>
<option value ="melbourne">Melbourne</option>
<option value ="cromwell">Cromwell</option>
<option value ="queenstown">Queenstown</option>
</select>

what is the name or id for that

Add one.

<select id="...." name=".....">
  <option value ="sydney">Sydney</option>
  <option value ="melbourne">Melbourne</option>
  <option value ="cromwell">Cromwell</option>
  <option value ="queenstown">Queenstown</option>
</select>

http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.6

masijade 1,351 Industrious Poster Team Colleague Featured Poster

forget roseindia. The only thing you'll learn there is bad habits.

javac like with every other Java library.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Hi masijade,
I'm a little bit confused with longest dup counter and current dup counter.
How do I keep the longest counter and reset the current dup counter when the value changes? Could you please give me an example code.?
Truyly appreciate,
VM

With two different variables, of course. That is why they are referred to with two different names.

valleymorning commented: Great idea! +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

So don't redirect. Have the servlet deliver it directly! As I have already said.

If the file is a pdf, set the response objects content type to pdf, read the PDF bytes and send them directly to the responses output stream.

Like I said, the servlet returns the file, it does not redirect. I never said anything about redirecting, I never even hinted at that!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like I have said before (and I believe to you) was write a servlet that takes a filename as one of the parameters and then have that servlet check the session information before returning the contents of the file. It is not that hard, already. I am not, however, going to just give you code for it. Try to write it. I will help you correct it, but I will not write it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Over the network?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No need for a map/table of any kind. It's a simple straight for loop run through the array and a few variables and a couple of if statements.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Loop through the array, saving the "last" value, as well as the currently "longest" duplicate (both what it is and how many there were, depending on what your output needs to be) and increment a "current duplicate" counter. Then, when the value changes, or the array ends, compare that counter with the "current longest" and make any adjusments you need to make.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I'm sorry, but I don't understand what you mean by

change the directory its trying to load

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First of all, use the classpath properly, do not place jars in the ext folder.

Second, read the documentation again, as it may be that you are suppossed to be using those classes through interfaces/factories rather than trying to instantiate them directly.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google "java3d". If I remember right, there is an API for this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Please explain your problem properly. Cant get it what you want.


From what I have understood... to find whether a string that ends with "," or ".",
eg.

String str = "Hello World.";
if(str.charAt(str.length-1)==',' || str.charAt(str.length-1)=='.')
{
    // Your Code
}

Huh? What's wrong with the "endsWith" method of String?

iamthwee commented: Common sense prevails! +22
masijade 1,351 Industrious Poster Team Colleague Featured Poster

So someone gace you an ugl and, most likely error-prone clotz of a workaround, and you might pass your assignment. You still haven't learned anything, so your next assignment is only going to be that much more bewildering. I can only hope that you wind up working with those people that did your homework for you so they can continue doing your actual work for you. Hopefully, by then, you will both have learned a lesson.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As I told you in your multipost:

Okay? So what do you have, and what error/compiler messages are you getting from it, or what is it doing that you don't expect, or vice-versa.

You will notice the terms and conditions of this site (which you agreed to when you signed up here), forbid us simply giving you a solution to your homework (as if we would, anyway).

P.S. Unless forbidden for you to use it, use SimpleDateFormat not any kind of case or "home-grown" solution. Why reinvent the wheel.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? So what do you have, and what error/compiler messages are you getting from it, or what is it doing that you don't expect, or vice-versa.

You will notice the terms and conditions of this site (which you agreed to when you signed up here), forbid us simply giving you a solution to your homework (as if we would, anyway).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A buffer for what?

There are a few classes actually called buffer in the API. You did read the API docs, right?

If worse come to worse, write your own.

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

Wht do you think CardLayout does in the background? And without all the fuss and "erone-pronedness" of doing it yourself.

You simply add each Panel to the CardLayout then, when a button is pushed, you tell the CardLayout which of those is to be displayed. Where's the problem?

But, hey, if you want to reinvent the wheel, go right ahead.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By asking on a JavaScript forum, maybe?

People here, however, due to the terms and conditions for this site, are not supossed to just "give it to you", though.

And Peter is correct. AJAX is JavaScript, it just has comes as a buch of "prepackaged" functions and utilities.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Unfortunately, not in the way he wishes. He wishes to have the user be able to select an option in one list, and from that, populate the options in the second list.

So, he can use those on the third option. I.E. when the user selects a value in the first drop down, the form gets submitted (probably to some alternate url, or the original must check whether the second list has a selected value or not), then he can use the JSTL query tags to populate the second list. But, JSTL does not help on the client-side. JSTL tags are used server-side. I.E. They are evaluated on the server in order to produce HTML.

Actually, he might use them in all of the options, the only question is when and how. In the first option, in order to find all possible values, and the second option in the page that the AJAX call refers to.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This "dynamic population", as you call it, would happen on the client side, but JSP, of course, runs on the server side, so you have three options

1. Send all of the data (either in the form of hidden fields or prepopulated JavaScript Arrays) and use JavaScript to replace the contents of one depending on the selection in the other.

2. Use AJAX to request a list of values from the server and update the second list whenever a value is chosen in the first.

3. Submit the form to populate the second list whenever a value is chosen in the first list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

CardLayout

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, with this line

while (t.hasMoreTokens() && t.countTokens() <= numNodes)

the "3" that marks the start of the next "matrix" also passes the test.

Wouldn't ">1 and <= num" work better?

Edit: Also, seeing as how those single numbers declare "square" matrices, it would make even more sense to make sure that you don't read more than that to begin with.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
/classes/my/package/some/sub/dir/myfile  getResource("/classes/my/package/some/sub/dir/myfile"
                                         getResource("some/sub/dir/myfile")

Oops! Obviously that one should be

/classes/my/package/some/sub/dir/myfile  getResource("/my/package/some/sub/dir/myfile"
                                         getResource("some/sub/dir/myfile")
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ha! Ha! Ha! Ha!

Read the terms and agreements of the site again. Which, by the way, you agreed to when you created your account here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No, they don't necessarily need to be in the same place, but it does need to be on the class path.

Say you have /classes on your classpath. And your class is my.package.MyClass. Then your class is located at /classes/my/package/MyClass.class. Assuming there are no other packages, then your file (named myfile) could be located in the following locations

/classes/myfile                          getResource("/myfile")
/classes/my/myfile                       getResource("/my/myfile")
/classes/my/package/myfile               getResource("/my/package/myfile")
                                         getResource("myfile")
/classes/my/package/some/sub/dir/myfile  getResource("/classes/my/package/some/sub/dir/myfile"
                                         getResource("some/sub/dir/myfile")
/classes/some/other/dir/myfile           getResource("/some/other/dir/myfile")
kvprajapati commented: Thanks +7
masijade 1,351 Industrious Poster Team Colleague Featured Poster

The associated errors would help. Also, provide the full path to the "root" directory of the classpath item that the class making the call resides in, and the full path to the actual file.

Also, check the access rights of the user to the file, and the directory it's in. And I hope that this "file" is not in a jarfile, right?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use a filter to check the session, if the user is not logged in, and he wishes to go to a protected site, save that url in a newly created session object and redirect the user to a login page. After a successful login, retreive that url from the session and redirect the user back to the site he wanted.

Short of that, if it is a protected page, and you don't want to use a filter, then check the session validity first, and if the user is not logged in, simply return an error. I don't see what the problem is.

It is up to you how you separate the "levels" of access. roles are usually a good way. Have each user have a specific role(s) and have the session checker check the users role(s) against the role(s) that are needed to get access to that page.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And what do you want of us? If it is to do your homework for you, then read the terms and conditions for this site (which you agreed to when you created your account).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And what are these last two post suppossed to mean?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Reread the first line of my post, then do that, and you can use the section of the tutorial included in my first post that handles those.

masijade 1,351 Industrious Poster Team Colleague Featured Poster