how to access object of one class in another class

X

xodepp shrestha

i am having problem in JDBC.there are two different class within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i need to call the connection object from the dbconnect class in the login class.
Please help me
 
A

Arved Sandstrom

i am having problem in JDBC.there are two different class within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i need to call the connection object from the dbconnect class in the login class.
Please help me
Start here: http://docs.oracle.com/javase/tutorial/

Part of what you need is specifically
http://docs.oracle.com/javase/tutorial/java/index.html, and even more
specifically http://docs.oracle.com/javase/tutorial/java/javaOO/index.html.

A newsgroup works best for targeted questions. If you don't know barely
anything about a subject you need to read books and tutorials.

AHS
 
L

Lew

xodepp said:
i [sic] am having problem in JDBC.there are two different class[es] within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i [sic] need to call the connection object from the dbconnect class in the login class.

You don't call classes in Java, you call methods.

You don't call objects in Java, you call methods.

What methods did you need to call?

I'm betting you spelled those class names wrong. If you created those classes,
then you failed to follow the Java naming conventions.

Spelling is crucial in Java, and the conventions are important.

Please provide an SSCCE.
http://sscce.org/

Arved's right. You need to start from the beginning. There's a lot of
material available for free, just an online search away.
 
G

Gene Wirchenko

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,440
Members
47,101
Latest member
DoloresHol

Latest Threads

Top