我试图在scala中覆盖dbcp BasicDataSource类,但我对编译器输出感到困惑。如果我尝试执行以下操作:
class MyBasicDataSource extends BasicDataSource {
}
我收到以下编译错误:
class MyBasicDataSource needs to be abstract, since: it has 3 unimplemented members. /** As seen from class MyBasicDataSource, the missing signatures are
as follows. * For convenience, these are usable as stub implementations. */ // Members declared in javax.sql.CommonDataSource def getParentLogger():
java.util.logging.Logger = ??? // Members declared in java.sql.Wrapper def isWrapperFor(x$1: Class[_]): Boolean = ??? def unwrap[T](x$1: Class[T]): T = ???
但我可以实例化一个新的BasicDataSource:
val ds = new BasicDataSource
所以它不是一个抽象类。我也可以在java中覆盖它而不会出现任何编译器错误。有人可以向我解释为什么我会收到这些编译错误吗?
由于 DES
答案 0 :(得分:0)
问题是我使用的dbcp 1.4和Java 7不兼容。升级到dbcp 2.0并修复它