Menu

incompatible data type in conversion when using TIME type‏

Help
GuillaumeF
2014-09-10
2016-04-27
  • Marco Amadei

    Marco Amadei - 2014-09-11

    Time type doesn't exist in access: it uses a datetime with a conventional day-month-year to represent a time instance.
    Because you don't have to know these boring details, I have tried to support the PreparedStatement.setTime(and the needed conversions) in the 2.0.9.
    Could you try it?
    Cheers Marco

     
  • Ihsan Ibrahim

    Ihsan Ibrahim - 2016-04-27

    hi Marco,

    For my latest project I'm using the following for my select MS Access statement :-

    select Nz([Connect_Time],'0') AS Expr1 from table

    I'm trying to get rid of null values using the Nz function.

    The message displayed when I run with apache-tomcat-7.0.63 is as follows :-

    HTTP Status 500 - net.ucanaccess.jdbc.UcanaccessSQLException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)

    type Exception report

    message net.ucanaccess.jdbc.UcanaccessSQLException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    java.lang.RuntimeException: net.ucanaccess.jdbc.UcanaccessSQLException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)
    Symproj.data.NewsItemDAO.findWorkingTran(NewsItemDAO.java:308)
    Symproj.web.monthlyProcessServlet.doPost(monthlyProcessServlet.java:216)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    root cause

    net.ucanaccess.jdbc.UcanaccessSQLException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)
    net.ucanaccess.jdbc.UcanaccessConnection.prepareStatement(UcanaccessConnection.java:506)
    Symproj.data.NewsItemDAO.findWorkingTran(NewsItemDAO.java:299)
    Symproj.web.monthlyProcessServlet.doPost(monthlyProcessServlet.java:216)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    root cause

    java.sql.SQLSyntaxErrorException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)
    org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
    org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
    net.ucanaccess.jdbc.UcanaccessConnection.prepareStatement(UcanaccessConnection.java:504)
    Symproj.data.NewsItemDAO.findWorkingTran(NewsItemDAO.java:299)
    Symproj.web.monthlyProcessServlet.doPost(monthlyProcessServlet.java:216)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    root cause

    org.hsqldb.HsqlException: routine signature not found for: PUBLIC.NZ(TIMESTAMP,CHARACTER)
    org.hsqldb.error.Error.error(Unknown Source)
    org.hsqldb.error.Error.error(Unknown Source)
    org.hsqldb.RoutineSchema.getSpecificRoutine(Unknown Source)
    org.hsqldb.FunctionSQLInvoked.resolveTypes(Unknown Source)
    org.hsqldb.QuerySpecification.resolveExpressionTypes(Unknown Source)
    org.hsqldb.QuerySpecification.resolveTypesPartOne(Unknown Source)
    org.hsqldb.QueryExpression.resolve(Unknown Source)
    org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
    org.hsqldb.ParserCommand.compilePart(Unknown Source)
    org.hsqldb.ParserCommand.compileStatement(Unknown Source)
    org.hsqldb.Session.compileStatement(Unknown Source)
    org.hsqldb.StatementManager.compile(Unknown Source)
    org.hsqldb.Session.execute(Unknown Source)
    org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
    org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
    net.ucanaccess.jdbc.UcanaccessConnection.prepareStatement(UcanaccessConnection.java:504)
    Symproj.data.NewsItemDAO.findWorkingTran(NewsItemDAO.java:299)
    Symproj.web.monthlyProcessServlet.doPost(monthlyProcessServlet.java:216)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    Appreciate your assistance on the above problem.

    Thanking u in advance.

     
  • Marco Amadei

    Marco Amadei - 2016-04-27

    '0' isn't a datetime so it can't be used as alternative value. Nevertheless Nz(datetime,datetime) isn't implemented yet, and this will be in the 3.0.5. In the meantime you may want to use the nvl function.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.