Author Topic: How do I define the database connection parameters?  (Read 6775 times)

nick

  • Newbie
  • *
  • Posts: 1
    • View Profile
How do I define the database connection parameters?
« on: January 18, 2007, 06:26:09 AM »
Where do I define the jdbc parameters for KonaKart?

I can't find a configuration file.

  ::) Nick

john

  • Administrator
  • Full Member
  • *****
  • Posts: 78
    • View Profile
    • KonaKart
Re: How do I define the database connection parameters?
« Reply #1 on: January 18, 2007, 06: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

yooifeng

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How do I define the database connection parameters?
« Reply #2 on: February 12, 2007, 02: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.

john

  • Administrator
  • Full Member
  • *****
  • Posts: 78
    • View Profile
    • KonaKart
Re: How do I define the database connection parameters?
« Reply #3 on: February 12, 2007, 04: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

yooifeng

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How do I define the database connection parameters?
« Reply #4 on: February 12, 2007, 06:41:26 AM »
Hi John,

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

Thanks John for your promptly reply. :)

john

  • Administrator
  • Full Member
  • *****
  • Posts: 78
    • View Profile
    • KonaKart
Re: How do I define the database connection parameters?
« Reply #5 on: February 12, 2007, 09:40:58 AM »
You're very welcome  :).  Please let us know if you run into any other problems.
John

oleg

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: How do I define the database connection parameters?
« Reply #6 on: March 02, 2007, 05:12:25 AM »
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

paolo

  • Administrator
  • Sr. Member
  • *****
  • Posts: 119
    • View Profile
Re: How do I define the database connection parameters?
« Reply #7 on: March 02, 2007, 06: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

oleg

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: How do I define the database connection parameters?
« Reply #8 on: March 02, 2007, 06: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 =

john

  • Administrator
  • Full Member
  • *****
  • Posts: 78
    • View Profile
    • KonaKart
Re: How do I define the database connection parameters?
« Reply #9 on: March 02, 2007, 06: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

oleg

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: How do I define the database connection parameters?
« Reply #10 on: March 02, 2007, 07:13:47 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

john

  • Administrator
  • Full Member
  • *****
  • Posts: 78
    • View Profile
    • KonaKart
Re: How do I define the database connection parameters?
« Reply #11 on: March 02, 2007, 07:23:40 AM »
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

oleg

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: How do I define the database connection parameters?
« Reply #12 on: March 02, 2007, 07:41:55 AM »

I have : MySQL - 5.0.24a-community   ???

msa

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: How do I define the database connection parameters?
« Reply #13 on: March 02, 2007, 07:52:47 AM »
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

Shaheem.

paolo

  • Administrator
  • Sr. Member
  • *****
  • Posts: 119
    • View Profile
Re: How do I define the database connection parameters?
« Reply #14 on: March 02, 2007, 08:05:24 AM »
Also remember that you have to re-start Tomcat to pick up the new values in the properties file.