public String checkcode(String getcode) throws
ClassNotFoundException {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:lianying", "", "");
Statement st = con.createStatement();
String sql = "select name from stock where code ="+getcode+"" ;
ResultSet tempFlag = st.executeQuery(sql);
tempFlag.next();
con.close();
}
catch (SQLException ex)
{
System.out.print(ex);
}
return null;
}
怎么连接不上数据库呢?数据源没有问题,