Dharmendran Govind

Greenhorn
+ Follow
since Sep 08, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dharmendran Govind

Thank you Tom for your reply.
First of all I am new to java. My computer does not have a CLASSPATH env variable. It has only the PATH variable and I added JDK to the path variable and I was able to complie simple java programs. so are you saying I need an env variable called CLASSPATH.
Hello,

I am getting error package not found com.ibm.as400.access.* when trying to compile or when opened in netbeans.
Any info is greatly appreciated. I spent whole of today trying to resolve this one.

Steps done:
1) I downloaded jtopen_7_1.zip and unziped into folder c:\jtopen_7_1
2) Added C:\jtopen_7_1\lib\jt400.jar in my path environment variable.
3) Restarted my computer.
4) Net beans keeps giving error msg cannot find package.

code is

public class AS400Access {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Inside JDBC Test");
try {
DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
} catch (SQLException e) {
System.out.println("AS/400 JDBC Driver not found");
System.out.println(e);
System.exit(0);
}
try {
conn = DriverManager.getConnection("jdbc:as400://DVLPMNT");
} catch (SQLException e) {
System.out.println("Connection failed with " + e.getMessage() + " ");
System.exit(0);
}

System.out.println("Connected to the AS400 OK...");
}
}

Please help

Regards
DGOVI
Henry

Classpath is .;C:\J2SDK1.4.2_16\BIN;C:\J2SDK1.4.2_16\LIB;C:\J2SDK1.4.2_16\JRE;C:\JAVA\PROGRAMS

The java files are in directory C:\JAVA\PROGRAMS

Thanks for your help.

Regards
Dharmendran
Henry

My classpath is

C:\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn;C:\J2SDK1.4.2_16\BIN;C:\J2SDK1.4.2_16\LIB;C:\J2SDK1.4.2_16\JRE;C:\JAVA\PROGRAMS
Vidhya

Thanks for the tip. I tried compling javac other\Child.java. It is now giving me a diff kind of error "cannot read: other\Child.java". For some reason the complier is not seeing the file...
Henry,

Nothing changed. I googled and someone had tried compling javac *.java and it worked for that person. I also tried compling issuing javac *.java instead of javac Child.java and looks like javac *.java works. No idea why?

Regards
Dharmendran
Vidhya,

I tried javac *.java and it complied fine.
Thanks for your help though.

Regards
Dharmendran
wow, Hendry did you do any thing special.
Can you please tell me how your classpath looks.
I have installed J2SDK1.4.2_16.

Regards
Dgovi
Vidhya,

Is'nt that what the code is doing? Trying to access variable X through inheritance, which is protected in the superclass that belong to a diff package.
Dear friends,

I am preparing for the SCP for java 2. I purchased this book by author Kathy Sierra. It is simply great...

I am trying out some simple programs from the book.

I had 2 classes in dir C:\JAVA\PROGRAMS

First one is Parent.java

package cert;
public class Parent {
protected int x = 9;
}


Second one is Child.java

package other;
import cert.Parent;
class Child extends Parent {
public void testIt() {
System.out.println("x is " + x);
}
}

The Parent class complies without issues. The Child class errors out saying "Cannot resolve symbol".

I googled the message and checked for my classpath and all seem to be ok.
Any help greatly appriciated.

Regards
Dgovi