How to quote/escape identifiers such as column names with JDBC?

前端 未结 3 1014
走了就别回头了
走了就别回头了 2021-01-17 16:29

Different database servers use different ways to quote and escape identifiers.

E.g. \"foo bar\" vs `foo bar` vs [foo bar], or \"10\"\"\" vs \"10\\\"\", or identifier

3条回答
  •  花落未央
    2021-01-17 16:49

    Have a look at

    DatabaseMetaData.getIdentifierQuoteString()
    

    I never used it but it sounds good :-)

    getExtraNameCharacters() could also be of some help

提交回复
热议问题