• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I debug it ?

 
scpark
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My package sturucture is as follows;
suncertify : 1. db ; Data.java, DataInfo.java, FieldInfo.java,
DatabaseException.java, db.db
2. server ; DataServer.java, Server.java, ServerImpl.java
3. client ; ...
After I successfully comfile db package, and set classpath for
server package, I encountered following same problems.
Does anyone can help me ?
==================================================
F:\job\Assignment\scjd\mysrc\suncertify\server>javac *.java
ServerImpl.java:34: Can't make static reference to method suncertify.db.FieldInf
o getFieldInfo()[] in class suncertify.db.Data.
return Data.getFieldInfo();
^
ServerImpl.java:41: Can't make static reference to method int getRecordCount() i
n class suncertify.db.Data.
return Data.getRecordCount();
^
ServerImpl.java:52: Can't make static reference to method suncertify.db.DataInfo
getRecord(int) in class suncertify.db.Data.
return Data.getRecord(recNum);
^
ServerImpl.java:67: Can't make static reference to method suncertify.db.DataInfo
find(java.lang.String) in class suncertify.db.Data.
return Data.find(toMatch);
^
ServerImpl.java:82: Can't make static reference to method void add(java.lang.Str
ing[]) in class suncertify.db.Data.
Data.add(newData);
^
ServerImpl.java:99: Can't make static reference to method void modify(suncertify
.db.DataInfo) in class suncertify.db.Data.
Data.modify(newData);
^
ServerImpl.java:111: Can't make static reference to method void delete(suncertif
y.db.DataInfo) in class suncertify.db.Data.
Data.delete(toDelete);
^
ServerImpl.java:120: Can't make static reference to method void close() in class
suncertify.db.Data.
Data.close();
^
ServerImpl.java:132: Can't make static reference to method void lock(int) in cla
ss suncertify.db.Data.
Data.lock(record);
^
ServerImpl.java:142: Can't make static reference to method void unlock(int) in c
lass suncertify.db.Data.
Data.unlock(record);
^
ServerImpl.java:159: Can't make static reference to method suncertify.db.DataInf
o criteriaFind(java.lang.String)[] in class suncertify.db.Data.
return Data.criteriaFind(criteria);
^
11 errors
F:\job\Assignment\scjd\mysrc\suncertify\server>
==================================================
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are calling methods statically, meaning you are using the Class name instead of the instance variable you created as a Data Object.
Meaning

myInstanceOfData.lock(2); is the kind of call you want to make not

when you call something like Data.lock(2) you are saying that the method signature of lock is:


Hope that helps
Mark
 
scpark
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Mark !
I could solve this problem by
add line -> Data data;
&
change -> Data.getFieldInfo();
=> data.getFieldInfo();

Thanks again !!
[ January 10, 2002: Message edited by: scpark ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic