File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem referencing array from another class

 
Parka Teoh
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an array in a jdbc class file.
But I can't reference it in another class file in the same package.


Here's my jdbc connection class code



and further down (in the same file )I have



in another file called file2.java, I tried to reference the array in the above file using the following...



I've got null printed.

I don't know what I've missed...

[ October 17, 2004: Message edited by: Parka Teoh ]
[ October 17, 2004: Message edited by: Parka Teoh ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parka,
Is the System.out.println() writing at least once? Maybe the query isn't returning any data.
 
Parka Teoh
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried System.out.println in the connection file too. And the queries were printed out correctly. I have 9 items, and all the 9 items were displayed.

But somehow when I run the other java file to reference the array from the connection file, it returns null.

hmmm...

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parka,
Since we've established this isn't a JDBC problem, I'm moving it to Java In General. The people who hang out there know a lot about the language itself and can be more helpful.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic