从java中的ResultSet中检索照片的路径

时间:2014-07-15 23:31:09

标签: java windows path odbc resultset

我正在使用odbc连接器。 我想知道如何从java中的resultSet中检索照片的路径。 在Windows上,路径有一个反斜杠(例如:“C:\test\rahul.jpg")所以当我尝试这个时:

String str = resultSet.getString ("Ar_photo"); 

我收到了错误(Error in assignment)。 因为路径不是java中的有效字符串。 知道我试图逃避数据库中路径的值,但我注意到这个odbc连接器不支持sql查询中的“替换”标量函数。 怎么办?

这是完整的堆栈跟踪:

java.sql.SQLException: [Simba][Simba ODBC Driver]Error in assignment.
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at com.connector.sageConnection.ProductQueries.getCreatedProducts(ProductQueries.java:97)
at com.connector.sageConnection.ODBCConnection.synchronizeProduct_SG_sl(ODBCConnection.java:126)
at com.connector.sageConnection.ODBCConnection.synchronizeDataFromSage(ODBCConnection.java:86)
at com.connector.UI.LoginMethod.synchronizeData(LoginMethod.java:57)
at com.connector.UI.Main$1.actionPerformed(Main.java:79)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

0 个答案:

没有答案