Servis-Rhino 4211B Guia do Utilizador Página 80

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 298
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 79
WL.Server.writeJMSMessage(options)
WL.Server.requestReplyJMSMessage(options)
SQL Adapter
The SQL adapter allows a Worklight client to execute SQL statements or stored procedures against
a back-end database. The SQL adapter encapsulates the calls to the database hiding the mechanics
of how this is achieved from the Worklight client developer.
Worklight supports DB2, Oracle and MySQL database access.
Before we dive deeper into the SQL Adapter, let us spend a little time talking about the Java JDBC
technology. JDBC is a Java specification that insulates a Java programmer from the mechanics of
interacting with a specific vendor's database implementation. For example, IBM with DB2 may
choose one style of technology, Oracle a different style and MySQL yet another style. If a Java
programmer had to accommodate different vendor characteristics, the Java applications would have
to differ for each database that could be used. JDBC insulates the programmer from that chore. It
provides an API that normalizes access. To allow for the distinctions between the DB providers,
JDBC assumes that each vendor will provide a JDBC compliant "driver". This will be Java code
built and distributed by the database vendor that allows JDBC to be able to form connections and
use the target database. Since this JDBC driver class conforms to the JDBC specification, it will
provide its half of the handshake to the database and the JDBC caller will leverage those functions.
The ability to connect to the database is only part of the insulation that JDBC provides. There will
also be configuration parameters that will need to be supplied by a client that wishes to use the
database. Such things will include the physical location of the database (local or networked) and
the name of the database to be accessed (a machine can presumably host multiple databases). Since
these configuration parameters are also vendor specific, they must be supplied when the client
wishes to connect with the target. These parameters are called the "JDBC Connection URL" as
they typically look like a web URL (though not always).
When a SQL Adapter is defined, the connection policy definition looks as follows:
We notice that there are properties specific for database access:
Url – The JDBC Connection URL used to connect to the target database. This value will
be database provider specific.
Driver class – The name of the JDBC driver class supplied by the DB vendor.
User – The name of the user under which the connection to the database will be performed.
Page 80
Vista de página 79
1 2 ... 75 76 77 78 79 80 81 82 83 84 85 ... 297 298

Comentários a estes Manuais

Sem comentários