Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    timestamp

    devo recuperare un valore di tipo timestamp (lastChange) da SQL Server 2000.
    per far ciò uso :

    java.sql.Timestamp timestamp = rs.getTimestamp("lastChange");
    dove rs è il ResultSet della query sul DB.

    solo che ottengo in seguente errore:

    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported data conversion.

    Motivo??

    Grazie!

  2. #2
    googlando ho trovato questo:

    "Can i get a java.sql.Timestamp from a timestamp column?

    No, you cannot get a java timestamp from a timestamp column of the SQL server. The timestamp column in the SQL server is not a column that contains a time or date. It contains a binary number (8 byte) that is unique in the database. You can get bytes from a timestamp field that can be read with the methods getBytes, getString or getBinaryStream.
    To get a java timestamp from a SQL Server column you need to use a date/time column in the SQL Server database.
    If you call getObject on a column that is a timestamp column in the SQL Server then you get a binary object. If you call toString on that binary object then you get something like "[B".
    "

  3. #3

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.