API java : SQLInput


java.sql
Interface SQLInput

All Known Implementing Classes:
SQLInputImpl

public interface SQLInput

An input stream that contains a stream of values representing an instance of an SQL structured type or an SQL distinct type. This interface, used only for custom mapping, is used by the driver behind the scenes, and a programmer never directly invokes SQLInput methods. The reader methods (readLong, readBytes, and so on) provide a way to read the values in an SQLInput object. The method wasNull is used to determine whether the the last value read was SQL NULL.

When the method getObject is called with an object of a class implementing the interface SQLData, the JDBC driver calls the method SQLData.getSQLType to determine the SQL type of the user-defined type (UDT) being custom mapped. The driver creates an instance of SQLInput, populating it with the attributes of the UDT. The driver then passes the input stream to the method SQLData.readSQL, which in turn calls the SQLInput reader methods in its implementation for reading the attributes from the input stream.

Since:
1.2

Method Summary
 Array readArray()
          Reads an SQL ARRAY value from the stream and returns it as an Array object in the Java programming language.
 InputStream readAsciiStream()
          Reads the next attribute in the stream and returns it as a stream of ASCII characters.
 BigDecimal readBigDecimal()
          Reads the next attribute in the stream and returns it as a java.math.BigDecimal object in the Java programming language.
 InputStream readBinaryStream()
          Reads the next attribute in the stream and returns it as a stream of uninterpreted bytes.
 Blob readBlob()
          Reads an SQL BLOB value from the stream and returns it as a Blob object in the Java programming language.
 boolean readBoolean()
          Reads the next attribute in the stream and returns it as a boolean in the Java programming language.
 byte readByte()
          Reads the next attribute in the stream and returns it as a byte in the Java programming language.
 byte[] readBytes()
          Reads the next attribute in the stream and returns it as an array of bytes in the Java programming language.
 Reader readCharacterStream()
          Reads the next attribute in the stream and returns it as a stream of Unicode characters.
 Clob readClob()
          Reads an SQL CLOB value from the stream and returns it as a Clob object in the Java programming language.
 Date readDate()
          Reads the next attribute in the stream and returns it as a java.sql.Date object.
 double readDouble()
          Reads the next attribute in the stream and returns it as a double in the Java programming language.
 float readFloat()
          Reads the next attribute in the stream and returns it as a float in the Java programming language.
 int readInt()
          Reads the next attribute in the stream and returns it as an int in the Java programming language.
 long readLong()
          Reads the next attribute in the stream and returns it as a long in the Java programming language.
 Object readObject()
          Reads the datum at the head of the stream and returns it as an Object in the Java programming language.
 Ref readRef()
          Reads an SQL REF value from the stream and returns it as a Ref object in the Java programming language.
 short readShort()
          Reads the next attribute in the stream and returns it as a short in the Java programming language.
 String readString()
          Reads the next attribute in the stream and returns it as a String in the Java programming language.
 Time readTime()
          Reads the next attribute in the stream and returns it as a java.sql.Time object.
 Timestamp readTimestamp()
          Reads the next attribute in the stream and returns it as a java.sql.Timestamp object.
 URL readURL()
          Reads an SQL DATALINK value from the stream and returns it as a java.net.URL object in the Java programming language.
 boolean wasNull()
          Retrieves whether the last value read was SQL NULL.
 

Method Detail

readString

String readString()
                  throws SQLException
Reads the next attribute in the stream and returns it as a String in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readBoolean

boolean readBoolean()
                    throws SQLException
Reads the next attribute in the stream and returns it as a boolean in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns false
Throws:
SQLException - if a database access error occurs

readByte

byte readByte()
              throws SQLException
Reads the next attribute in the stream and returns it as a byte in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readShort

short readShort()
                throws SQLException
Reads the next attribute in the stream and returns it as a short in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readInt

int readInt()
            throws SQLException
Reads the next attribute in the stream and returns it as an int in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readLong

long readLong()
              throws SQLException
Reads the next attribute in the stream and returns it as a long in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readFloat

float readFloat()
                throws SQLException
Reads the next attribute in the stream and returns it as a float in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readDouble

double readDouble()
                  throws SQLException
Reads the next attribute in the stream and returns it as a double in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns 0
Throws:
SQLException - if a database access error occurs

readBigDecimal

BigDecimal readBigDecimal()
                          throws SQLException
Reads the next attribute in the stream and returns it as a java.math.BigDecimal object in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readBytes

byte[] readBytes()
                 throws SQLException
Reads the next attribute in the stream and returns it as an array of bytes in the Java programming language.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readDate

Date readDate()
              throws SQLException
Reads the next attribute in the stream and returns it as a java.sql.Date object.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readTime

Time readTime()
              throws SQLException
Reads the next attribute in the stream and returns it as a java.sql.Time object.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readTimestamp

Timestamp readTimestamp()
                        throws SQLException
Reads the next attribute in the stream and returns it as a java.sql.Timestamp object.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readCharacterStream

Reader readCharacterStream()
                           throws SQLException
Reads the next attribute in the stream and returns it as a stream of Unicode characters.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readAsciiStream

InputStream readAsciiStream()
                            throws SQLException
Reads the next attribute in the stream and returns it as a stream of ASCII characters.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readBinaryStream

InputStream readBinaryStream()
                             throws SQLException
Reads the next attribute in the stream and returns it as a stream of uninterpreted bytes.

Returns:
the attribute; if the value is SQL NULL, returns null
Throws:
SQLException - if a database access error occurs

readObject

Object readObject()
                  throws SQLException
Reads the datum at the head of the stream and returns it as an Object in the Java programming language. The actual type of the object returned is determined by the default type mapping, and any customizations present in this stream's type map.

A type map is registered with the stream by the JDBC driver before the stream is passed to the application.

When the datum at the head of the stream is an SQL NULL, the method returns null. If the datum is an SQL structured or distinct type, it determines the SQL type of the datum at the head of the stream. If the stream's type map has an entry for that SQL type, the driver constructs an object of the appropriate class and calls the method SQLData.readSQL on that object, which reads additional data from the stream, using the protocol described for that method.

Returns:
the datum at the head of the stream as an Object in the Java programming language;null if the datum is SQL NULL
Throws:
SQLException - if a database access error occurs

readRef

Ref readRef()
            throws SQLException
Reads an SQL REF value from the stream and returns it as a Ref object in the Java programming language.

Returns:
a Ref object representing the SQL REF value at the head of the stream; null if the value read is SQL NULL
Throws:
SQLException - if a database access error occurs

readBlob

Blob readBlob()
              throws SQLException
Reads an SQL BLOB value from the stream and returns it as a Blob object in the Java programming language.

Returns:
a Blob object representing data of the SQL BLOB value at the head of the stream; null if the value read is SQL NULL
Throws:
SQLException - if a database access error occurs

readClob

Clob readClob()
              throws SQLException
Reads an SQL CLOB value from the stream and returns it as a Clob object in the Java programming language.

Returns:
a Clob object representing data of the SQL CLOB value at the head of the stream; null if the value read is SQL NULL
Throws:
SQLException - if a database access error occurs

readArray

Array readArray()
                throws SQLException
Reads an SQL ARRAY value from the stream and returns it as an Array object in the Java programming language.

Returns:
an Array object representing data of the SQL ARRAY value at the head of the stream; null if the value read is SQL NULL
Throws:
SQLException - if a database access error occurs

wasNull

boolean wasNull()
                throws SQLException
Retrieves whether the last value read was SQL NULL.

Returns:
true if the most recently read SQL value was SQL NULL; false otherwise
Throws:
SQLException - if a database access error occurs

readURL

URL readURL()
            throws SQLException
Reads an SQL DATALINK value from the stream and returns it as a java.net.URL object in the Java programming language.

Returns:
a java.net.URL object.
Throws:
SQLException - if a database access error occurs, or if a URL is malformed
Since:
1.4

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

6 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1087
Document créé le 28/08/06 23:07, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/sql/SQLInput.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,93 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Un ami, c'est quelqu'un qui vous connaît bien et qui vous aime quand même.

Hervé Lauwick
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 19:44, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)