Github user gtapper commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/457#discussion_r61673018
  
    --- Diff: docs/jdbct4ref_guide/src/asciidoc/_chapters/accessing.adoc ---
    @@ -0,0 +1,910 @@
    +////
    +/**
    + *@@@ START COPYRIGHT @@@
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements. See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + * @@@ END COPYRIGHT @@@
    + */
    +////
    +
    +[[accessing-project-name-sql-databases]]
    += Accessing {project-name} SQL Databases
    +
    +[[data-sources]]
    +== Data Sources
    +
    +The term *data source* logically refers to a database or other data
    +storage entity. A JDBC (client) data source is physically a Java object 
that
    +contains properties such as the URL of the physical database, the
    +catalog to use when connecting to this database, and the schema to use
    +when connecting to this database. The JDBC data source also contains
    +methods for obtaining a JDBC connection to the underlying database.
    +
    +[[jdbc-data-source-client-side]]
    +=== JDBC Data Source (client-side)
    +
    +All JDBC data source classes implement either the `javax.sql.DataSource`
    +interface or the `javax.sql.ConnectionPoolDataSource` interface. The Type
    +4 driver data source classes are `org.trafodion.t4jdbc.HPT4DataSource` and
    +`org.trafodion.t4jdbc.HPT4ConnectionPoolDataSource`. (These classes are
    +defined by the JDBC 3.0 specification.)
    +
    +Typically, a user or system administrator uses a tool to create a data
    +source, and then registers the data source by using a JNDI service
    +provider. At run time, a user application typically retrieves the data
    +source through JNDI, and uses the data source's methods to establish a
    +connection to the underlying database.
    +
    +A DataSource object maps to an instance of a database. In the Type 4
    +driver product, the DataSource object acts as an interface between the
    +application code and the database and enables connection with an DCS
    +data source.
    +
    +[[security]]
    +== Security
    +
    +Clients connect to the {project-name} platform with a valid user name
    +and ID, using standard JDBC 3.0 APIs. An application can make multiple
    +connections using different user IDs, and creating different Connection
    +objects.
    +
    +The Type 4 driver provides for user name and password authentication.
    +The password is encrypted with a proprietary algorithm provided by DCS.
    +
    +NOTE: There is no secure wire communication such as SSL provided for the
    +communication between Type 4 driver and the {project-name} platform.
    +
    +<<<
    +[[connection-by-using-the-datasource-interface]]
    +== Connection by Using the DataSource Interface
    +
    +The `javax.sql.DataSource` interface is the preferred way to establish a
    +connection to the database because this interface enhances the application
    +portability. Portability is achieved by allowing the application to use a
    +logical name for a data source instead of providing driver-specific 
information
    +in the application. A logical name is mapped to a `javax.sql.DataSource`
    +object through a naming service that uses the Java Naming and Directory
    +Interface (JNDI). Using this DataSource method is particularly recommended
    +for application servers.
    +
    +When an application requests a connection by using the `getConnection` 
method
    +in the `DataSource`, then the method returns a `Connection` object.
    +
    +A `DataSource` object is a factory for `Connection` objects. An object that
    +implements the `DataSource` interface is typically registered with a JNDI
    +service provider.
    +
    +[[overview-of-tasks-to-deploy-datasource-objects]]
    +=== Overview of Tasks to Deploy DataSource Objects
    +
    +Before an application can connect to a `DataSource` object, typically
    +the system administrator deploys the `DataSource` object so that
    +the application programmers can start using it.
    +
    +Data source properties are usually set by a system administrator using
    +a GUI tool as part of the installation of the data source. Users to
    +the data source do not get or set properties. Management tools can get
    +at properties by using introspection.
    +
    +Tasks involved in creating and registering a database object are:
    +
    +1. Creating an instance of the `DataSource` class.
    +2. Setting the properties of the `DataSource` object.
    +3. Registering the `DataSource` object with a naming service that uses
    +the Java Naming and Directory Interface (JNDI) API.
    + 
    +An instance of the `DataSource` class and the `DataSource` object
    +properties are usually set by an application developer or system
    +administrator using a GUI tool as part of the installation of the
    +data source. If you are using an installed data source, then see
    +<<programmatically-creating-an-instance-of-the-datasource-class, 
Programmatically Creating an Instance of the DataSource Class>>.
    +
    +The subsequent topics show an example of performing these tasks 
programmatically.
    +
    +For more information about using data sources, see 
https://docs.oracle.com/javase/tutorial/jdbc/basics/sqldatasources.html[Connecting
 with DataSource Objects]
    +in the https://docs.oracle.com/javase/tutorial/jdbc/TOC.html[JDBC(TM) 
Database Access: Table of Contents] documentation
    +or other information available in the field.
    +
    +<<<
    +[[datasource-object-properties]]
    +=== DataSource Object Properties
    +
    +A `DataSource` object has properties that identify and describe the actual
    +data source that the object represents. These properties include such
    +information as the URL (the primary IP address or host name of the 
database),
    +the database schema and catalog names, the location of the database server,
    +the name of the database, and so forth.
    +
    +For details about Type 4 driver properties that you can use with the 
`DataSource` object, see <<type-4-driver-properties,Type 4 Driver Properties>>.
    +
    +[[programmatically-creating-an-instance-of-the-datasource-class]]
    +=== Programmatically Creating an Instance of the DataSource Class
    +
    +A JDBC application can set `DataSource` properties programmatically and
    +register with a DataSource object. To get or set `DataSource` object 
properties programmatically, use the
    +appropriate getter or setter methods on the `HPT4DataSource` object or
    +the `HPT4ConnectionPoolDataSource` object.
    +
    +*Example*
    +
    +[source, java]
    +----
    +HPT4DataSource temp = new HPT4DataSource() ;
    +temp.setCatalog( "Seabase" ) ;
    +----
    +
    +In the following example, the code fragment illustrates the methods that a
    +`DataSource` object `ds` needs to include if the object supports the
    +`serverDataSource` property `ds.setServerDataSource( 
"my_server_datasource" )`.
    +In this example, the code shows setting properties for the 
`HPT4DataSource` object
    +to use the Type 4 driver to access a {project-name} database:
    +
    +[source, java]
    +----
    +HPT4DataSource ds = new HPT4DataSource() ;
    +
    +ds.setUrl( "jdbc:hpt4jdbc://<primary IP addr or host name>:18650/" );
    +ds.setCatalog( "Seabase" ) ;
    --- End diff --
    
    The catalog? It's my understanding that the only catalog for Trafodion is 
named Seabase?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to