0

value="jdbc:mysql://localhost:8080/mkyongjava" i need to change this path so that it works at my place. where will I get this?

    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost:8080/mkyongjava" />
        <property name="username" value="root" />
        <property name="password" value="password" />
    </bean>
2
Contributors
1
Reply
24
Views
4 Years
Discussion Span
Last Post by cool_zephyr
0
  1. set up mysql in your localhost
  2. create a database named mkyongjava in your mysql
  3. modify username and password properties according to the values given at mysql setup
  4. modify your connection url..usually mysql listens on port 3306

Here's an example

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/your_database_name" />
    <property name="username" value="your mysql username" />
    <property name="password" value="your mysql password" />
</bean>

don't forget to add the related mysql-connector jar file into your classpath.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.