Java ORA-00942:表或视图不存在,即使它存在

Java ORA-00942:表或视图不存在,即使它存在,java,oracle,spring-boot,jdbc,Java,Oracle,Spring Boot,Jdbc,当我尝试从oracle数据库中读取时,出现以下错误: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist 但是,我已经在客户机上使用相同的凭据测试了该查询,它可以正常工作。可能有什么问题 在下面找到我的连接设置: @Bean(name="eJDBCDatasource") @ConfigurationProperties(prefix = "spring.datasourceexample") pu

当我尝试从oracle数据库中读取时,出现以下错误:

java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
但是,我已经在客户机上使用相同的凭据测试了该查询,它可以正常工作。可能有什么问题

在下面找到我的连接设置:

@Bean(name="eJDBCDatasource")
@ConfigurationProperties(prefix = "spring.datasourceexample")
public DataSource eJDBCDatasource(){
    return DataSourceBuilder.create().build();
}

@Bean(name="exampleNmpJDBCTemplate")
public NamedParameterJdbcTemplate exampleNmpJDBCTemplate(@Qualifier("eJDBCDatasource") DataSource eJDBCDatasource){
    return new NamedParameterJdbcTemplate(eJDBCDatasource);
}
和我的配置:

spring.datasourceexample.url=jdbc:oracle:thin:@//X.X.X.X:1521/EXDB
spring.datasourceexample.username=read
spring.datasourceexample.password=readp
spring.datasourceexample.driverClassName=oracle.jdbc.driver.OracleDriver
spring.datasourceexample.max-active=50
spring.datasourceexample.initial-size=20
spring.datasourceexample.max-idle=5
spring.datasourceexample.min-idle=1
spring.datasourceexample.test-while-idle=true
spring.datasourceexample.testOnBorrow=false
spring.datasourceexample.validationQuery=SELECT 1
spring.datasourceexample.time-between-eviction-runs-millis=5000 
spring.datasourceexample.min-evictable-idle-time-millis=60000
spring.datasourceexample.unreturnedConnectionTimeout=30000
spring.datasourceexample.debugUnreturnedConnectionStackTraces=true
spring.datasourceexample.maxIdleTimeExcessConnections=300
以及查询:

@Autowired
NamedParameterJdbcTemplate exampleNmpJDBCTemplate;

public Boolean isExample(String Id) {

    SqlParameterSource param = new MapSqlParameterSource()
            .addValue("id", Id);
    List result = (List) exampleNmpJDBCTemplate.queryForList(this.examplesearchQuery, param);
    return !result.isEmpty();
}
解决了这个问题 我在应用程序中有其他数据源连接。因此,我需要添加@Qualifier注释

@Autowired
@Qualifier("exampleNmpJDBCTemplate")
NamedParameterJdbcTemplate exampleNmpJDBCTemplate;

甲骨文不会说谎。如果您使用与sqlplus相同的用户名登录,会发生什么?它可以工作。我已经解决了这个问题。谢谢