English 中文(简体)
查询后gres 选择不返回结果吗?
原标题:query postgres select does not return results?

我正在开发一个 java 应用程序, 我使用结果片。 我写这个查询, 它的工作效果, 我得到结果

SELECT * 
FROM BD 
WHERE 
    CAST(parent_id AS integer) = " + (Integer.parseInt(arrHeading[0])) + " 
    AND CAST(section AS double precision) = " + Double.parseDouble(arrHeading[1]) + "";

ar heading is type string type string ,但当我写下面的查询时,它不会返回任何结果。 cas is type chainacter different(12) .我遇到了麻烦,因为它是一个字符,我不知道我为什么没有得出任何结果。我用引号尝试过,但仍然没有结果。有想法吗?

SELECT * 
FROM BD 
WHERE 
    CAST(parent_id AS integer) = " + (Integer.parseInt(arrHeading[0])) + " 
    AND CAST(section AS double precision) = " + Double.parseDouble(arrHeading[1]) + "
    AND cas =  " + arrHeading[2] + " ";
最佳回答

我将建议首先用查询中的实际值,即硬代码 cas="您的 valiue" 来替换 Arr Heading [2], 代之以查询中的实际值, 即硬代码 cas=" 您的 valiue ", 看看查询是否返回任何结果 。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签