D
dhyzf
Unregistered / Unconfirmed
GUEST, unregistred user!
AdminCon_bean.java:
import java.sql.*;
public class AdminCon_bean
{
String DriverName="sun.jdbc.odbc.JdbcOdbcDriver";
String DBName="jdbcdbc:userdb";
String User="";
String Pwd="";
Connection conn;
Statement stmt;
public AdminCon_bean(){
try{
Class.forName(DriverName);
conn=DriverManager.getConnection(DBName,User,Pwd);
stmt=conn.createStatement();
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
}
Insert_bean.java:
import java.sql.*;
import AdminCon_bean;
public class Insert_bean
{
private AdminCon_bean conn;
public Insert_bean(){
conn=new AdminCon_bean();
}
}
javac AdminCon_bean.java 通过;
javac Insert_bean.java出现:
D:/mis98>javac Insert_bean.java
Insert_bean.java:2: 不能解析符号
符号:类 AdminCon_bean
import AdminCon_bean;
^
Insert_bean.java:5: 不能解析符号
符号:类 AdminCon_bean
位置:类 in Insert_bean
private AdminCon_bean conn;
^
Insert_bean.java:7: 不能解析符号
符号:类 AdminCon_bean
位置:类 in Insert_bean
conn=new AdminCon_bean();
请问应如何解决;
import java.sql.*;
public class AdminCon_bean
{
String DriverName="sun.jdbc.odbc.JdbcOdbcDriver";
String DBName="jdbcdbc:userdb";
String User="";
String Pwd="";
Connection conn;
Statement stmt;
public AdminCon_bean(){
try{
Class.forName(DriverName);
conn=DriverManager.getConnection(DBName,User,Pwd);
stmt=conn.createStatement();
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
}
Insert_bean.java:
import java.sql.*;
import AdminCon_bean;
public class Insert_bean
{
private AdminCon_bean conn;
public Insert_bean(){
conn=new AdminCon_bean();
}
}
javac AdminCon_bean.java 通过;
javac Insert_bean.java出现:
D:/mis98>javac Insert_bean.java
Insert_bean.java:2: 不能解析符号
符号:类 AdminCon_bean
import AdminCon_bean;
^
Insert_bean.java:5: 不能解析符号
符号:类 AdminCon_bean
位置:类 in Insert_bean
private AdminCon_bean conn;
^
Insert_bean.java:7: 不能解析符号
符号:类 AdminCon_bean
位置:类 in Insert_bean
conn=new AdminCon_bean();
请问应如何解决;