Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 05 Dec 2002 @ 20:50:27 GMT


     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 


Subj:   JDBC Driver
 
From:   Michael Crutcher

I'd like to use a type-2 jdbc driver to connect to our database. I'm using this type of driver because a gateway is not installed on the teradata machine, and I have no physical access to the machine, and therefore no way to add the packages required to run the gateway. I'd like to use a TeraConnectionPoolDataSource object to handle connection pooling. For this purpose I'm binding a context to a data source and then querying the data source for the connection objects.

My problem is that to create a Context object I need to have an environment setup (through passing a hashmap representing the environment to InitialContext's constructor). As far as I can tell the environment only requires two entries in the hashmap:

1. Context.INITIAL_CONTEXT_FACTORY

2. Context.PROVIDER_URL

The value of the initial context factory is easy enough: "com.sun.jndi.fscontext.RefFSContextFactory". I'm really stumped about what to pair with the provider url, however (the teradata docs are of absolutely no help either). The example given in the teradata docs lists the value paired with provider url as: "file:/tmp/jdbc/ds1". Obviously this is just a file that sits on the machine running the java virtual machine. The documentation never mentions what goes in this file, or where I might find it. Has anyway set up a DataSource object? Can anyone help, or at least point me in a useful direction?

The example code I'm referencing is in the teradata documentation's JDBC book, under chapter 4: examples. It's the data source or pooled data source example. The snippets in question are:

Hashtable env2 = new Hashtable();

env.put
(Context.INITIAL_CONTEXT_FACTORY,
'com.sun.jndi.fscontext.RefFSContextFact=
or
y');

// this is the one I don't know about

env.put(Context.PROVIDER_URL, 'file:/tmp/jdbc/ds1');

// later on the env hashmap is used to create a context object

Context ctx = new InitialContext(env);

Ctx.bind('Teradata1', ds);

Thanks in advance,

Michael Crutcher
Texas A&M University



     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023