Spring Security Oracle sql Question (incompatible column index)

Asked 2 years ago, Updated 2 years ago, 103 views

List<String> type =getJdbcTemplate().query( SQL , new String[] {id, id}, new RowMapper<String>() {
SELECT  USER_TYPE
FROM (
    SELECT 
        'user' as USER_TYPE
    FROM
        TABLE_USER
    WHERE 
        USER_ID=?
    UNION
    SELECT
        'admin' AS USER_TYPE
    FROM
        TABLE_ADMIN
    WHERE
        ADMIN_ID=?
)

If you type the query on the console above, it comes out well, but it says it's an invalid column index in the code. What's the problem?

oracle java database spring-security

2022-09-22 14:00

1 Answers

Please put a semicolon at the end of the query.


2022-09-22 14:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.