I'm new to java , i've tried to make simple jdbc application .
I can store a value in database and also can retrieve it but only in console window.
i've got the variable String name in package db, and what should i do to display the value of that "name" variable in output area(op) of another package of called ui.
please help me with this

Recommended Answers

All 2 Replies

When you have a variable in one class that you want to get the value of in another class, you can add a getter method to the class with the variable and have the other class call that method. A getter method is a method that returns a value. For example put this method in the class with the data:

public DataTypeHere getData() {
  return data;  // return the value of data
}

Thanks....dude IT WORKS !!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.