KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: nick on January 18, 2007, 11:26:09 am

Title: How do I define the database connection parameters?
Post by: nick on January 18, 2007, 11:26:09 am
Where do I define the jdbc parameters for KonaKart?

I can't find a configuration file.

  ::) Nick
Title: Re: How do I define the database connection parameters?
Post by: john on January 18, 2007, 11:30:29 am
Hi Nick,  (Homer!?),

There's a properties file for this under webapps/konakart/WEB-INF/classes/konakart.properties.

More details on this can be found in the FAQ at:

http://www.konakart.com/installationfaq.php#Defining_Database_Parameters

John
Title: Re: How do I define the database connection parameters?
Post by: yooifeng on February 12, 2007, 07:04:04 am
Hi John,

If my torque.database.default                         = dbA

and i change all oscommerce word to dbA in the config file  (e.g. torque.dsfactory.dbA.connection.driver   = com.mysql.jdbc.Driver),

I am getting below error , please advice.


"com.konakart.app.KKException: Unable to connect to the Database called dbA. En
sure that the database is running
and if so, check the database connection parameters in the konakart.properties
file under WEB-INF/classes.
        at com.konakart.app.KKEng.initTorque(KKEng.java:195)
        at com.konakart.app.KKEng.init(KKEng.java:140) "


P/S: I am able to use Toad for mysql to connect dbA.
Title: Re: How do I define the database connection parameters?
Post by: john on February 12, 2007, 09:14:29 am
Hi,

You shouldn't change all the oscommerce references.   Only change the values for these parameters:

torque.database.oscommerce.adapter              = mysql
torque.dsfactory.oscommerce.connection.driver   = com.mysql.jdbc.Driver
torque.dsfactory.oscommerce.connection.url      = jdbc:mysql://localhost:3306/dbname?zeroDateTimeBehavior=convertToNull
torque.dsfactory.oscommerce.connection.user     = username
torque.dsfactory.oscommerce.connection.password = password

It is most likely you will only need to change the last three shown above.

Good luck,
John
Title: Re: How do I define the database connection parameters?
Post by: yooifeng on February 12, 2007, 11:41:26 am
Hi John,

Thanks a lot, i can connect my db from my oscommerce website now.

Thanks John for your promptly reply. :)
Title: Re: How do I define the database connection parameters?
Post by: john on February 12, 2007, 02:40:58 pm
You're very welcome  :).  Please let us know if you run into any other problems.
John
Title: Re: How do I define the database connection parameters?
Post by: oleg on March 02, 2007, 10:12:25 am
Quote from: john on February 12, 2007, 02:40:58 pm
You're very welcome  :).  Please let us know if you run into any other problems.
John


Hi,
i can not connect my db
-----------------------------------------------------------------------------------
torque.database.oscommerce.adapter              = mysql
torque.dsfactory.oscommerce.connection.driver   = com.mysql.jdbc.Driver
torque.dsfactory.oscommerce.connection.url      = jdbc:mysql://localhost:3306/dbname?zeroDateTimeBehavior=convertToNull
torque.dsfactory.oscommerce.connection.user     = root
torque.dsfactory.oscommerce.connection.password =
-------------------------------------------------------------------------------------------------

ERROR:
he details of the malfunction are :

Exception Name = com.konakart.al.KKAppException
Exception Message = com.konakart.app.KKException: Unable to connect to the Database called oscommerce. Ensure that the database is running and if so, check the database connection parameters in the konakart.properties file under WEB-INF/classes.
Exception Stack Trace =
at com.konakart.al.KKAppEng.(KKAppEng.java:264)
at com.konakart.actions.BaseAction.getKKAppEng(BaseAction.java:69)
at com.konakart.actions.CatalogMainPageAction.execute(CatalogMainPageAction.java:56)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio.........
......

??? Oleg
Title: Re: How do I define the database connection parameters?
Post by: paolo on March 02, 2007, 11:10:38 am
Hi Oleg,

You need to configure the database connection parameters. Try following the instructions that you can find in earlier posts within this thread.

Paolo
Title: Re: How do I define the database connection parameters?
Post by: oleg on March 02, 2007, 11:41:28 am
Hollo I make ales constantly more heier wi. But no success.
My konakart.properties:
torque.database.default                         = oscommerce

torque.database.oscommerce.adapter              = mysql
torque.dsfactory.oscommerce.connection.driver   = com.mysql.jdbc.Driver
torque.dsfactory.oscommerce.connection.url      = jdbc:mysql://localhost:3306/oscommerce?zeroDateTimeBehavior=convertToNull
torque.dsfactory.oscommerce.connection.user     = root
torque.dsfactory.oscommerce.connection.password =


Imma ERROR
Exception Name = com.konakart.al.KKAppException
Exception Message = com.konakart.app.KKException: Unable to connect to the Database called oscommerce. Ensure that the database is running and if so, check the database connection parameters in the konakart.properties file under WEB-INF/classes.
Exception Stack Trace =
Title: Re: How do I define the database connection parameters?
Post by: john on March 02, 2007, 11:50:54 am
Oleg,

Your settings look good.   Have you verified that you can access your database (that you've called "oscommerce") using MySQL tools using that username and password?

John
Title: Re: How do I define the database connection parameters?
Post by: oleg on March 02, 2007, 12:13:47 pm
Quote from: john on March 02, 2007, 11:50:54 am
Oleg,

Your settings look good.   Have you verified that you can access your database (that you've called "oscommerce") using MySQL tools using that username and password?

John

Hi John
username=root
:o
Other one web min username root connect no problem
Title: Re: How do I define the database connection parameters?
Post by: john on March 02, 2007, 12:23:40 pm
Hi Oleg,

If I understand you correctly, using MySQL tools you were able to log in to your oscommerce database using user root, with no password?   Is that correct?   Did you see all the oscommerce tables?

This is tricky to diagnose from here. The error clearly reports that it cannot connect to the database - so this should be a big clue.   If you can log in using MySQL tools then you should be able to log in using exactly the same parameters in the KonaKart properties file.

John
Title: Re: How do I define the database connection parameters?
Post by: oleg on March 02, 2007, 12:41:55 pm

I have : MySQL - 5.0.24a-community   ???
Title: Re: How do I define the database connection parameters?
Post by: msa on March 02, 2007, 12:52:47 pm
Maybe a reinstall of konakart would solve the problem. It just takes a few mins and the instruction are on the FAQ section http://www.konakart.com/installationfaq.php (http://www.konakart.com/installationfaq.php)

Shaheem.
Title: Re: How do I define the database connection parameters?
Post by: paolo on March 02, 2007, 01:05:24 pm
Also remember that you have to re-start Tomcat to pick up the new values in the properties file.