Tuesday, March 20, 2007

Connecting PostgreSQL 8.1 & ColdFusion MX 7

So far ColdFusion does not have a default driver to connect to a PostgreSQL Database. However you can manually create a connection using a JDBC driver.

  1. Download the JDBC driver http://jdbc.postgresql.org/
    You need to know what is your JDK version so that you can select the proper driver. To check your JDK version open Terminal and type:

    java --version

    In my case I have "1.4.2", therefore I downloaded JDBC 3 for PostgreSQL 8.1
  2. Copy the driver (jar file) to your coldfusion location at:

    [cf root folder]/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib

    in my case this was:
    /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib

  3. Restart ColdFusion:
    cd into /opt/jrun4/bin/ and type:

    ./jrun -restart

    NOTE: for some reason when I execute this command it my system won't complete the restart process so I had to do a Stop and Start like ./jrun -stop and then ./jrun -start

  4. Now go to your ColdFusion admin add a new Data Source of type "Other"
  5. Enter your JDBC URL as: jdbc:postgresql://localhost/[your database name]
  6. Set Driver Class and Driver Name as: org.postgresql.Driver
  7. Enter the user name and password.
    Note: You can use your "postgres" user account. I have instead created a specific account for coldfusion, you can create users through pgAdmin.
  8. Submit. You should get an "ok" in the status.

3 comments:

Anonymous said...

I'm sorry Roland for hijacking your comment space. I tried your script of auto915reoslution fix but it didn't work for me. I have made a detailed post with all Xorg.conf, 915resolution -l, DDCprobe & stuff at http://www.ubuntuforums.org/showthread.php?t=395685 Please take a look at it & lemme know if I did something wrong.

Anonymous said...

Please delete the 2 posts after u have seen my ubuntu forum post. Sorry again.

Rolando said...

Hi,

I took a look at your post and your startup scripts were not created.

You mentioned you executed auto915Resolution using sudo so I'll assume you had root privileges. I can only think of two things that would cause this problem:
1. That you did not CD into auto915Resolution folder before executing it. For example that instead of typing : "cd /home/[your user name]/auto915Resolution/" and then execute the script you might have done something like "./[your username]/auto915Resolution/auto915resolution.sh"
that would cause a problem because you're outside of the folder.

2. You do not have a init.d directory. I have Ubuntu and that's what I tested this script so if you have something else this might not work.

If you're not using Ubuntu then you still can use 915resolution and create the startup scripts manually.

Before doing this though you should run 915resolution, replace ALL the mode(s) that match your current resolution with your desired resolution. MAKE SURE that you do not enter a higher resolution than what your system can take BECAUSE you'll just end up in trouble.

After doing this restart X by pressing ctrl + alt + Backspace key combination.
STOP! :)

this will close all your windows so read below before pressing the key combination.

If you see your resolution fixed then do the following:

In terminal try: "sudo gedit /etc/default/915resolution"

enter your working resolution by providing values for XRESO and YRESO where X is horizontal and Y is vertical resolution, and restart.

Please, let me know if this works and Also post OS flavor and version, it will help me research why the startup-scripts where not created.