peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No, as we have following rule, We only give homework help to those who show effort, so you better start read something like this

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Jazzy is such library, for more options here is result of google search

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I believe you talking about server - mobile device communication. Fill in loging form on mobile device, forward it to server for processing and depending of the login process determinate next step.
Basic idea of this connection is discussed in Chapter 10 - Connecting to World from book Beginning J2ME, From Novice to Professional. To extend on topic a network data security would be nice addition, Chapter 18 - Protecting Network Data

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry about that, String[] prodValues = (String)ar.toArray();

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
//rs is the resultset

ArrayList ar=new ArrayList();

while(rs.next())
{
    String strprodvalue = rs.getString("prodvalue");
    out.println(strprodvalue);
    ar.add(strprodvalue);
}

int size = ar.size();
String[] prodValues = ar.toArray();
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can do all above with ArrayList. However if you insist no conversion and working with array then, ArrayList class documentation will tell you that you are provided with method size(), toArray() or with toArray(T[] a)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Moved, in the future please use "Flag Bad Post" and type short message such as "Please move to XYZ section" and somebody from mod team will do it

EDIT: Now both threads are merged and there should be minimum to none confusion

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Use ArrayList (or any other Collection type you prefer) instead of Array. For array you would have to run extra query determinate number of elements that will come out to give you array size. That you would have to initialize array with that size and only after that you could execute query to retrieve data.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

you can use
Arrays.toString(int[] array)

Good suggestion too

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

For each loop

int[] intArray = getMyArray();
for(int i: intArray)
{
    arrayAsString = arrayAsString + i;
}

Don't you want to provide some sort of separator between values (space, comma, semicolon, etc)?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. Applying text formatting on your post doesn't help you to get positive attention, so please do not use bold and italic formatting to make your post something special. Use it only to highlight important part in problem description not whole post
2. Use of code tags would be nice
3. Use of full English is expected
4. If you added System.out.println(output); you would see your combined string

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Dunno how old is that book but you better have look at this Applets tutorial

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. If teach yourself java in 21 days telling you to save things in installation of Java throw in the bin. If it was your idea smack your self on hand. Do not mess with installation.
2. Check if you have Java Path set in your environment variables otherwise you will need to prove this path every time you compile (Java installation instructions and how to check it)
3. You need to be more careful with spelling Grphics != Graphics

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

BlueJ is just a tool and doesn't provide different/unusual/strange/special Java code, so no point mentioning it.
As for HashSet you can read this tutorial

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Read/write with mobile application is same thing as with traditional Java GUI/command line based application, only difference is that you have limited number of Stream classes. Number of examples can be found with help of Google.
Main issue in I/O operations is locating file from which to read or give direction as where to save the file. Here is example of midlet browsing mobile phone directory tree that I wrote last year

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No JSP is not supported be general host companies as it does require either Java web server or container (Tomcat, JBoss, Jetty, GlassFish etc.). You need to google for Java web hosting. I got hosting from daylirazor.

tiny7415 commented: Peter answered my question very well. +0
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Check this correction

if (c == reservationform.cmdDisplayBookingList){

            Display display = Display.getDisplay(ZSecondReservationMIDlet.zreservationmidlet);
            try {
                StringBuffer buffer = new StringBuffer();
                recordstore = RecordStore.openRecordStore("reservationlist", true);
                recordenumeration = recordstore.enumerateRecords(null, null, false);
                byte[] byteinputdata;
                ByteArrayInputStream inputstream;
                DataInputStream datainputstream;


                while (recordenumeration.hasNextElement()) {
                    int i = recordenumeration.nextRecordId();
                    byteinputdata = recordstore.getRecord(i);
                    try {
                        inputstream = new ByteArrayInputStream(byteinputdata);
                        datainputstream = new DataInputStream(inputstream);
                        String test = datainputstream.readUTF();

                        System.out.println(test);
                        //else buffer.append(test);
                        buffer.append(test);
                        //System.out.println(test);
                        //buffer.append(datainputstream.readUTF());
                        buffer.append("\n");
                        buffer.append(datainputstream.readUTF());
                        buffer.append("\n");
                        buffer.append(datainputstream.readUTF());
                        buffer.append("\n");

                        //Alert alert1=new Alert("Reservatin List",buffer.toString(),null,AlertType.INFO);/////////////////
                        //alert1.setTimeout(Alert.FOREVER);
                        //display.setCurrent(alert1);	/////////////////////////
                        //buffer.delete(0, buffer.length());/////////////

                        inputstream.close();
                        datainputstream.close();
                    } catch (IOException e) {

                        e.printStackTrace();
                    }


                }//while

                Alert alert1 = new Alert("Reservatin List", buffer.toString(), null, AlertType.INFO);/////////////////
                display.setCurrent(alert1);    /////////////////////////
                System.out.println(buffer.toString());

            } catch (RecordStoreException e) {

                e.printStackTrace();
            }

            finally {
                try {
                    recordstore.closeRecordStore();
                } catch (RecordStoreException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }

If you want have look on Contact sorting - Contact List, Part 3 article/tutorial that I wrote some time ago. It does show how to work with RecordStore, also you will see how to more efficiently organize your application

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry I do not know anyone of this forum with sufficient knowledge to answer your question. You better try to post on some Android forum...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Never did anything with midlet & GPS, but try to have look at these articles

PS: It doesn't matter what emulator or device you use as long you have access to appropriate libraries...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you post updated code I will have look at it (presuming that yo already found and solved login problem with password ;) )

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Threads merged, please read forum rules in regards of posting

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

well spotted jwenting, it does show how often I use command line :$

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You may want to use

java -classpath PATH_TO_CONNECTOR_INCLUDING_NAME YOUR_PROGRAM_NAME

for example JAR file on same level as your application

java -classpath mysql-connector-java-3.1.12-bin.jar MyDatabaseProgram
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need server/container to run JSP. You can go without database, but I wouldn't do it without servlets. JSP pages would just become too messy

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To accept 3 number and find max among three number(using && for checking multiple experssion)

Please help me, I am a beginner in this discipline, and I hope I explain the problem

Good starting point would be provide what you did so far and take it from there...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1st page form where you check/select checkbox or radio button and submit to server. On server side, servlet, you increment vote count for selected person, retrieve all data, put it in session and forward it to second page. On second page you retrieve session and populate view. All in all it is very similar to the mVC2 tutorial on top of JSP section...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

As you are working on mobile application, validation should be done before you attempt to connect with server.
All you need to do is just create a method that will return boolean type (true/false) and inside that method verify that text filed wasn't left empty if must be filled, that length of string is as expected (for example no less then 6 characters and no more then 18) etc. JME, makes checks much simpler since you can declare field to accept only numeric, phone type or email values with little hassle.
This is how simple it gets...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I guess you did not use Thread in your connection and because it is mobile device reply will slower then to emulator, therefore connection will time-out. Have look here how to do it with thread

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

JAD is not need it, it is usually used when mobile device accessing web for download and you need fast way to determinate if your device will be capable to run midlet associated with that JAD.
I wonder why it is giving you unsupported format??? What device you using?
Do you want to upload midlet or perhaps whole NetBeans project so others can see and try?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Upload your midlet (JAR file of it) on mobile phone either memory card or device memory trough USB cable or bluetooth, from mobile phone browse and search for the file (most of the phones have menu option like "Files", "Media"). Once you find it click install it, simple like that...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Closing down this double post, if you wish to reply to above question please post here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Everything possible see here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thread closed.

If OP or people with similar application need are looking for help they better come with some solid work and ask more then general questions.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Here you go

Ezzaral commented: The only possible response :) +10
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sessions as they been designed for this task

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Instead of using this

String value1=text1.getText();

you should use setter and getter methods.

setIP(text1.getText());
//do not forget value1 declaration at the start of your code
//as private String value1;

private void setIP(String string){
    value1 = string;
}

public String getIP(){
    return value1;
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Most simple without any checks for entry validity will be Naming.rebind(text1.getText()) . More complex with validation will do more less same Naming.rebind(validate(text1.getText())) where you send what ever retrieved from user to validation method that will check that string is in appropriate format (4 sets of numbers berween 0-255)

BestJewSinceJC commented: Useful, concise help, besides, sandyben did not mark the thread as solved... +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
private static MyClass MyClass() {
		return null;
	}

What are you trying to achieve with this declaration?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not sure about your whole classes so here are some examples
Class Car

public class Car{
	//default constructor
	public Car(){}
	
        //constructor takes car colour as initialization value
	public Car(String col){
		setColor(col);
	}
	
	String color;
	public void setColor(String col)
    {
    	color = col;
	}   	
		
	public String getColor()
	{
	   return color;
	}
}

Class CarTest

public class CarTest{
	public static void main(String[] args){
		Car myCar = new Car();
		myCar.setColor("Red");
		System.out.println(myCar.getColor());
		myCar = new Car("Blue");
		System.out.println(myCar.getColor());
	}
}

I guess you misunderstood the way setters are used. The value to which you wish to assigned is passed in between brackets and not by direct assignment as you tried.
Also the value you wish to assign can be also passed directly through class declaration with use of constructor ( public Car(String col) ). Class can have number of constructors depending on your needs ( public Car(String color, String manufacturer, String fuel, int speed, boolean inStock )

PS: In the scenario when constructors are used setter methods to which parameters are passed by constructor become private. Reason is simple you do not want that any class accessing Car class can change these values randomly and possibly create havoc with your results

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

how to set path? after typng the program is not getting executed. it is showing tat javac is not recognized so please tell wat to do

First post here explain how to install Java and how to set PATH

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Moved to JavaScript. In the future please make sure you post in correct section.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Question what this has to do with Java Server Pages? Your page is linked to PHP. Are you sure you didn't wanted to post in JavaScript?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well lets see what compiler says about this code

C:\Projects - Home\Daniweb\MyClass.java:7: cannot find symbol
symbol  : method MyClass()
location: class MyClass
        MyClass mc = MyClass();
                     ^
C:\Projects - Home\Daniweb\MyClass.java:8: possible loss of precision
found   : double
required: int
        int a = 1.5;
                ^
C:\Projects - Home\Daniweb\MyClass.java:9: non-static variable b cannot be referenced from a static context
        System.out.println(b);
                           ^

First error is telling you that it cannot find symbol method MyClass(). As you did not tell compiler that you want to cast new instance of your class its automatically assume that you want to call method of same name as is class, but that method does not exists. So what needs to be done?

Second error possible loss of precision. Your variable "a" is of type int, however for once you are redeclaring its type which you shouldn't. Secondly on integer you are trying to force double. So what did you wanted to do here?

Third error non-static variable b cannot be referenced from a static context. As error states you"b" have to be declare static if you want to use it from here.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Java is not a markup language where upper and lower case doesn't matter. Same goes for brackets and opening and closing. Lastly, there is a specific way to write the main method.

So based on what I said, what your compiler tells you about the above code?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

printStackTrace() is method that helps you to print out stack of errors messages that was thrown for some reason. In these messages you can find out where was error caused and then you can investigate.

jbInit() is method to add GUI components to frame. Don't you read that code setLayout(), setText(), add()

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please post the code and error received and we will try to assist

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Tell your friends they are no friends at all, otherwise they would tell you that you are missing Vector import at the start of PlanetField, that you missing declaration of variable position so you can access GetY method from line 50 and also that return statement on line 51 doesn't make any sense

BestJewSinceJC commented: Lol. +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Isn't this sufficient? GATE Example Code

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Already answered in post 11 and please start using code tags and stop reposting that useless roseindia link

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Please use code tags when posting any code
2) Did you actually downloaded the Commons FileUpload package and included in your project?
3) Every forum member is asked to used full sentence English. Chat/SMS type of writing is not welcome.
4) NetBeans is not compiler but IDE. If you do not like it you can use IntelliJ IDEA, Eclipse or command line
5) The tutorial that you are trying to follow is about getting data from client to server, where from your description of problem you want from server do client you are wasting your time with it...