Difference between revisions of "Database Resource"

From PresenceWiki
Jump to: navigation, search
Line 9: Line 9:
 
  user=admin
 
  user=admin
 
  password=presadmin
 
  password=presadmin
 +
 +
Note, this tab also displays the internal Resource ID for this resource.
  
 
http://www.international-presence.com/images/docs/res/sql/sqlres_connectiondetails.png
 
http://www.international-presence.com/images/docs/res/sql/sqlres_connectiondetails.png
Line 29: Line 31:
 
We set the variables before an SQL Node
 
We set the variables before an SQL Node
  
  ${control.database.override}
+
  <b>${control.database.override}</b>
 
   
 
   
 
  This is specified then the SQL Node will use the SQL Resource with this ID rather than its specified resource
 
  This is specified then the SQL Node will use the SQL Resource with this ID rather than its specified resource
 
  The ID for a resource can be found on the Connection tab of the SQL Resource
 
  The ID for a resource can be found on the Connection tab of the SQL Resource
 
   
 
   
  ${control.database.user}
+
  <b>${control.database.user}</b> SQL node will use this value for the username in the connection
 
   
 
   
  ${control.database.password}
+
  <b>${control.database.password}</b> SQL node will use this value for the password in the connection
  
  
 
For more info on how to connect to different types of database and how to aid connection pooling see [[Database Connectivity]]
 
For more info on how to connect to different types of database and how to aid connection pooling see [[Database Connectivity]]

Revision as of 16:29, 22 January 2010

In the Connection Details tab we specify the name of the resource and the driver class, which may need to be imported via the jar manager.

After this the we need the connection url which may or may not include the database name.

The properties file is if you wish to set the connection properties via a file,

for instance in the case shown, you could override the username and password by creating a file props.txt

user=admin
password=presadmin

Note, this tab also displays the internal Resource ID for this resource.

http://www.international-presence.com/images/docs/res/sql/sqlres_connectiondetails.png

A test of the connection should reveal:-

http://www.international-presence.com/images/docs/res/sql/sqlres_connected.png

As it is common to store the username and password in the SQL Node, rather than the Resource, the Global Password Update tab

provides a way to update the username and password for all SQL Nodes that use this SQL Resource.

http://www.international-presence.com/images/docs/res/sql/sqlres_passwordupdate.png

Note it is also possible to override the username and password and even SQL Resource for an SQL Node via presence variables, namely:-

http://www.international-presence.com/images/docs/res/sql/sqlres_vars.png

We set the variables before an SQL Node

${control.database.override}

This is specified then the SQL Node will use the SQL Resource with this ID rather than its specified resource
The ID for a resource can be found on the Connection tab of the SQL Resource

${control.database.user} SQL node will use this value for the username in the connection

${control.database.password} SQL node will use this value for the password in the connection


For more info on how to connect to different types of database and how to aid connection pooling see Database Connectivity