masijade 1,351 Industrious Poster Team Colleague Featured Poster

We are not just simply going to do your homework. Tell us your answers, and we might, I repeat might tell you if you're right.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look at the last line of parthibans post again. You were already provided with an answer for this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

JavaScript != Java

This is the Java forum, not the JavaScript forum. The designers did not just simply forget to include "Script" in the name, they are really two different things.

Next time post into the JavaScript forum. I have already asked the moderators to move this thread.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Whether to use serialisation, and whether to use a DB, are not mutually exclusive. There is no reason why you cannot store a serialised object in a DB.

What, exactly, is you want to know? If it is how to se a DB, then consult the JDBC tutorials at Sun first.

parthiban commented: Thanks +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

At the top of this forum is a fixed post to a tutorial. Read through some of that, try something out, if it doesn't work post your code and I'll help, but I'll not do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

are you using ksh or bash? if so

set -A aArray `print "$a" | sed -e 's/-/ /'`
set -A bArray `print "$b" | sed -e 's/-/ /'`
# now ${aArray[0]} and ${bArray[0]} contain the year
# and ${aArray[1]} and ${bArray[1]} contain the day
# and ${aArray[2]} and ${bArray[2]} contain the month

The comparison parts you can do yourself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Start your own thread, but that "error" is always that the path is not set (not classpath, path).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

He wants that, because the song goes

On the twelveth Day of Christmas
My true love gave to me
12 Drmmers Drumming
11 Pipers Piping
10 .....
masijade 1,351 Industrious Poster Team Colleague Featured Poster

you're looking for ints, and the last one must be mutiplied by 10 other wise the int value will always be 0 (obviously) and the first one divided by ten or it will be e.g. 10 instead of 1.

int tens=(int) ((v / 10) % 10);
int ones=(int) (v % 10);
int tenths=(int) ((v * 10) % 10);
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why are you doing System type stuff using Java? It is not designed for it. If you want a command line command to get the "application" list that appears in TaskManager, then why are you asking in a Java forum? Ask in some Windows forum somewhere.

Edit: And this is the JSP forum. What you have posted is not JSP, but rather Java (nominally).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Thanks for your reply masijide ,
Please confirm me what I understood from your reply is correct .so that I feel I can continue to study further.

What I understood from your is :

I registered the button(gui's button) with insGui object so it's(insGui) actionPerformed method will be invoked which in it's(insGui) button object 's setText method is invoked . so I'm not able to see the event triggered(Since in that frame(gui's frame) insGui's button object is not added or insGui button is not added to any frame at all) .

Am I right ?

and also tell me how can I make it to happen as you asked

That is when I click this button(gui's) insGui's button have to change .

Thanks in advance

That would all be correct, if you had defined insGui anywhere, but you didn't. To tell you the truth, I think you should be getting exceptions everytime you push the button (since insGui is not defined). As I said first, you should simply use "this", instead of "insGui".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You should probably add a button.validate() call after the button.setText() calls. And use "this" not "insGui". The reason nothing is happening when you use "insGui, is because you have not defined it anywhere. And even if you had, It would have it's own "button" object, which is the one you would be setting the text on, not on the "button" object of the one you are pushing the button on. (Or are you purposely trying to get the actions from one JFrame to affect items in another?)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the API for String. There is a method there, inherited from Object, with the same name as the symbol used in many comparisons. Use that method. (And, yes, I am being purposely obscure.)

Edit: Aaarrgh, and another newb has already given code. Do not give out easy answers without the poster showing some initiative. I can almost guarntee this is some sort of homework/assignment question, and he should do those himself, not just be given an answer.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does super have to do with anything here?

Also, it might help to know what error you're getting.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show the actual code. The above "process" doesn't really tell us much. For example, what, exactly, is the "necessary file IO"? A FileInputStream, a FileReader, a Scanner? Is that wrapped in a BufferedWhatever? etc, etc.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try it. Think of how you might do it, and try it out, then post that if it doesn't work, and we'll nudge you again. Hint: Use Google to search for an SQL reference.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And pay attention to reply number 13. It will make your life soooooo much easier.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes, it is possible, and is much more of an SQL question. Have you tried doing it? Post what you have tried.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What, three's the charm? Or what? Seeing as how the other two didn't get it, and the comments that went with their denials, what makes you think we'll give it to you?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show an example (of the input and the desired output), as well as the code you have for doing it (at least what you have so far).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It is actually better to place it inside of WEB-INF/lib, unless you are certain that it is needed by, and will not interfere with, other applications on the same server.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the API for File, namely the method listRoots.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

(num1,num2,num2));

Classic typo. And isn't it grand! ;-)

I hazard to guess, that it is a little embarrassing to have it come this far before being found, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why did you start a new thread? Because you didn't like the answers you were getting?

Please, do not multi-post in this manner. Stick with the original thread.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the "Getting Started" Tutorial. And don't save anything to the "bin" directory (or any other directory inside of the jdk directory).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go through the tutorials without using any IDE whatsoever. Once you understand all the concepts (such as classpath and the like), then you can start worrying about an IDE.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Check which quote you are using. On the keyboard it should be the one that slants from the upper left to the lower right, not the other way around and not straight up and down. In the code, it should also appear to slant in that direction and not appear in one of the other two ways.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you mean "you want to pass it as a parameter". Explain, without reference to URLs, JOptionPanes, Parameter Passing, or anything else technical, what it is, exactly that you want to accomplish.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the API for JOptionPane. I assume you're letting him enter a URL, in that case you already have the URL, you simply need to capture the return value of the JOptionPane method. As I said, read the API for that (and the tutorial), it explains it completely.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read the Swing tutorial. You are looking for ActionListener.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The same response I gave in the JSP forum for this question. Move all of this scriptlet stuff out of the JSP into one, or more, beans.

iamthwee commented: You can tell em but they don't listen. +9
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Are you using Java 1.5 or later? If so, make it an Integer array, rather than an int array. Then "empty" spots will be null and you just (after having filled it with the random numbers) cycle through with an == null check. And, you can still do array[j] = 1; or some other int, because autoboxing will automatically convert it to an Integer. You can also, later, use the Integer as if it were a normal int. That seems to be easiest solution.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

& as for he 2nd suggestion, yes I commented that on purpose. as the readdata() is inside main()...........please tell me whats going wrong here.


If I remove 1 "}" at the end as I think there is an extra. the above error is not there anymore but its showing another one:

Syntax error, insert "}" to complete MethodBody

    at dbpack.chartdb.main(chartdb.java:15)

on this line............. public static void main(String[] args) {

Well, I'm sorry but you cannot do that (comment out that }) as then your main method is not ended, or you then are (as noted above) are defining a method within a method.

Go through your code carefully and balance your braces "{ }", properly, then try to compile again. If it still does not compile, then post your modified code here again, with the new, complete, error message, and we can continue.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I believe this may be your problem

public static void main(String[] args) {
        // TODO Auto-generated method stub
        //private void  readData()
    //}
        
    private PieDataset readData()        {

Did you really mean to comment out the } at the end of your main method? Somehow I don't think so.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I'm not sure the code you posted there will even compile. You have a for block using a runCount variable inside of a try/catch block inside of a for block using a runCount varaiable (again) inside a try block with no catch block (at least not posted).

Clean that code up, first, then try to run it again, and if it still doesn't work, then ask again. And, once you do cmdProcess.waitFor(), any code below that point will not execute until the command has finished. Which, since you are not consuming the Streams of the process, might be never, if it produces enough output to fill the buffer.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

When you initiate the array (i.e. int[][] array = new int[20][20]; ) every position is already filled with 0 (since a primitive cannot be null). So, if zero is not one of the numbers you are using, simply cycle through the arrays with a nested loop replacing 0 with 99.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well this is guaranteed to get you answers.

Have you never heard of Google?

Or even the command "man ftp", since that, itself, describes the .netrc file and your "logfile" can be simple output redirection ">".

Id10t

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So read a quick Networking tutorial on Sun. They are easier to use than the lockfile routine you just tried.

Then again, you didn't write that code.

Read the networking tutorial, give the ServerSocket a try, then, if it doesn't work, post your code here and we will help you correct it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go back to reply number 1.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Bind a ServerSocket. If it fails to bind then abort the startup. Since a ServerSocket can be bound only once, only single instsances of the program will be able to run.

And before you ask, no. Just because you bind a ServerSocket, does not mean you are open to network traffic. That only comes into effect once the program starts "listening" to the port with accept().

~s.o.s~ commented: Nice. +24
masijade 1,351 Industrious Poster Team Colleague Featured Poster

And you got it in the first post.

iamthwee commented: too right! +11
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is the database running? Is it running on port 3306? Is there a firewall active blocking the port? Are you attempting to connect to the right host? Are you attempting to connect to 3306? Are you using the correct tablename in the connection url? Is the username and password correct? Is MySQL configured to allow that user, with that password, to connect from where the user is attempting to connect from?

I think that pretty much covers the possibilites.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look at the Process class and its exitValue() method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You still haven't provided your code, so we can still only guess. If you are doing things in the "standard" constructor, it should work, but I wouldn't count on it. If you have any other constrcutor, then forget it, as it will never be called. For the most part, however, instance/class variables in a Servlet are usually not a good thing. Most people just starting use them wrongly and have from very serious side effects from it.

As I said, provide your code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What exactly are you trying to do, and what error messages / unwanted effects are you getting / seeing?

The code in question would help, alot.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes it is. Instead of simply pushing on the blue (right pointing) triangle, click next to it to get the pull down, and select something like "configuration" and play around in there a while.

You would be better off, however, since you are learning, programming with a simple, highlight capable, editor and the compiling on the command line, rather than using an IDE.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First of all, What thing in bold?

Second of all, why did you start a new thread?

Rather than sticking with http://www.daniweb.com/forums/thread81344.html ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I will bet that currently, you have a JRE_HOME defined in your Tomcat configuration, but not a JAVA_HOME. Define JAVA_HOME in your Tomcat configuration and the problem should go away.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
Alarm a = new Alarm();
Thread t = new Thread(a);
t.start();

Alarm implements runnable, that means it must define a method run, but it is not, in itself a Thread object. The method start is a method of Thread. You create a new Thread with your Alarm object by creating an instance of Thread including in the "new" call an instance of your Alarm class (i.e. a Runnable object). Then you call start on the thread, which in turn, executes your run method.

If you want to be able to call a.start(), then you need to make Alarm extend Thread rather than implement Runnable.

I think you need to reread the Thread tutorials.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
total += 1000;

Assuming total is the variable.