Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我向其他系统发送队列并计划访问数据库以存储一些图片时,我遇到了 Java JMS 的这个问题。
我在编译器中遇到了这个错误:
对连接的引用不明确,java.sql 中的接口 java.sql.Connection 和 javax.jms 中的接口和接口 javax.jms Connection 都匹配 Connection connection = null;
这应该是对代码的一个非常简单的调整,但我不确定如何。有任何想法吗?
您必须使用完全限定的类名,即 java.sql.Connection 或 javax.jms.Connection。否则编译器不知道你指的是哪个连接接口。