Connecting ConsultComm to a Database
Consultant Communicator can upload all of your projects and times to any
JDBC or most ODBC compliant databases! Here's a few quick steps on how to get
database connectivity working:
- Get a JDBC driver. Check with the company that sells your database
product or your local database administrator to see if they have a JDBC
driver you can use. Sun offers a list at http://industry.java.sun.com/products/jdbc/drivers.
You can also use the JDBC-ODBC Bridge Driver that comes with Java 1.3 or
higher if you have ODBC installed (this will probably make exporting to a
database much slower, however). If you want to use the ODBC brige, skip to
step 4.
- Once you have the correct JAR or ZIP files, place them in the Java
Runtime Environment's extensions directory (see Important
Directories You Might Need to Know for the location of your extensions
directory).
- Find out what the driver name is for the JAR or ZIP files you just placed
in the extensions directory. The name is usually something like
"com.ibm.as400.access.AS400JDBCDriver".
- Find out what the database URL is. Check with our database administrator
if you are unsure... it usually follows the form "jdbc:as400://192.168.0.0"
where "as400" would be replaced by a specific driver label and
"//192.168.0.0" would be the IP address of a remote database (probably
"local" if you are using a local database).
If you are using the JDBC-ODBC bridge just enter in the name of the data
source you wish to use.
- Start up ConsultComm and go to Tools->JDBC Settings
- Enter in all relevant information. If you are using a specific JDBC
driver, fill in the driver name and URL you found in steps 3 and 4 (if you
selected the ODBC bridge the driver name will be grayed out). Be sure and
enter in the database name and table name you will be exporting your times
to.
- Hit "Test" to make sure your driver works. You will be prompted for a
username and password to access the database. If your verification
fails,double-check your settings and try again.
- Go to the "Field Mappings" tab. It may take a few seconds, but soon a
table will pop up listing all the fields for the table you specified in step
6.
- Fill in all the necessary values for the fields in your table. If you
want to export a value from ConsultComm you can type in one of the following
variables and ConsultComm will automatically convert it:
$USERNAME
- The username you enter in when authenticating
to the database
$PROJECT
- The Project Name
$HOURS
- The number of hours worked on a project
$DATE
- Today's date
$BILLABLE
- The "Billable Project" flag
All other values you type in will be interpreted literally. For example, I
might have the following settings in a table EMPHRS:
Field Name | Type | Value |
EMPNAME | CHAR | $USERNAME |
EMCHARGE | BIT | $BILLABLE |
EMHOURS | DECIMAL | $HOURS |
EMPROJ | CHAR | $PROJECT |
EMDATE | TIMESTAMP | $DATE |
EMLINE | DECIMAL | 0 |
EMCSLT | CHAR | Y |
- Click on the "Options" tab. Here you can set constraints on the variables
that you entered in on step 9. You can select from the following choices:
- Export Hours By:
- Quarter of an hour (i.e. 1:37 becomes 1.5)
- Tenth of an hour (i.e. 1:37 becomes 1.6)
- Full Precision (i.e. 1:37 becomes 1.62)
- Date Type:
- SQL Date (for fields with type DATE)
- SQL Date (for fields with type TIMESTAMP)
- Decimal Date (i.e. 10/01/01 becomes 20011001)
- Upper Case Project:
If checked will make all project names UPPERCASE when exporting to a
table
- Hit OK when you're happy with the changes.
- When you're ready to send your time to a table, go to Tools->Export to
Table. Hopefully everything will work fine ;)
If you are having problems, check the project page at
http://sourceforge.net/projects/consultcomm.
Search through the discussion forums or the bug reports to see if your
problem has been addressed. If you are having problems with the ODBC Bridge
check Sun's JDBC-ODBC Bridge
page at http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
If you still can't find an answer you can submit a bug report for
ConsultComm. Be sure to include:
- Your name and e-mail address
- The name of the company/product that the JDBC driver is released under
- The driver name
- The database URL (masquerading any info that needs to stay secure)
- A list of fields, types and values you have assigned to them
- The specific error returned