Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to access object of one class in another class

Reply
Thread Tools

how to access object of one class in another class

 
 
xodepp shrestha
Guest
Posts: n/a
 
      02-20-2013
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
 
Reply With Quote
 
 
 
 
Arved Sandstrom
Guest
Posts: n/a
 
      02-20-2013
On 02/20/2013 04:04 AM, xodepp shrestha wrote:
> 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/tutori...aOO/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
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      02-20-2013
xodepp shrestha wrote:
> 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.

--
Lew
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      02-21-2013
On Wed, 20 Feb 2013 05:27:19 -0400, Arved Sandstrom
<(E-Mail Removed)> wrote:

>On 02/20/2013 04:04 AM, xodepp shrestha wrote:
>> 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/tutori...aOO/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.


And a newsgroup is great for finding out about the good books and
tutorials.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Can a method in one class change an object in another class? Stewart Midwinter Python 5 03-07-2005 03:30 PM
How to access: a page from a User control, and another User controlfrom another one? qwerty ASP .Net 3 09-30-2004 05:32 PM
Using One XSLT and multiple XML Problem (One is XML and another one is XBRL) loveNUNO XML 2 11-20-2003 06:47 AM
Passing value from one script on one page to another script on another page. Robert Cohen ASP General 3 07-15-2003 01:46 PM



Advertisments