Skip to main content
Participant
April 6, 2009
Question

StoredProcedures On MySQL

  • April 6, 2009
  • 2 replies
  • 842 views

EU criei duas StoredProcedures no MySQL 5.0.5 que funcionam perfeitamente bem quando eu as acesso via PHP, mas dá erro no ColdFusion e eu não sei porque... gostaria de ter ajuda.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
April 11, 2009

If I remember well, stored procedures started with MySQL 5. The JDBC driver of the MySQL version that comes with your Coldfusion version may therefore be older than the one your procedure requires. To test this, install a new driver, as follows:

1) Download the MySQL 5.0.51 JDBC driver or, preferably, the most recent community version, 5.0.77.

2) Stop Coldfusion. Go to the folder {CF_wwwroot}/WEB-INF/lib/ and move any file of type mysql-connector-java-x.x.x-bin.jar to your documents directory. Should anything go wrong, you will have to restore this file back to its original location.

3) Unpack the zip file you downloaded in step 1. Copy the JAR file to the directory {CF_wwwroot}/WEB-INF/lib/

4) Restart ColdFusion
5) In the ColdFusion Administrator, add a new data source for your stored procedure, using the driver option Other
6) Enter the JDBC URL. It should be something like
jdbc:mysql://localhost:3306/myDatabaseName
7)Enter the Driver Class:
com.mysql.jdbc.Driver

8) Enter the MySQL username and password

9) Press the button to verify the settings

10) Run the code containing the stored procedure

Participant
April 7, 2009

I create 2 StoredProcedures in MySQL  5.0.51b that works very well with PHP, but dont works with ColdFusion. Why? I need help, please!