Announcement Announcement Module
Collapse
No announcement yet.
IPv6 support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IPv6 support

    Hi..
    I am using org.springframework.version -- >3.1.0.RELEASE and my datasource is like below

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" scope="prototype">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="username" value="test"/>
    <property name="password" value="test123"/>
    <property name="maxActive" value="100"/>
    <property name="maxIdle" value="30"/>
    <property name="maxWait" value="16000"/>
    <property name="timeBetweenEvictionRunsMillis" value="30000"/>
    <property name="minEvictableIdleTimeMillis" value="60000"/>
    <property name="testOnBorrow" value="true"/>
    <property name="validationQuery" value="SELECT 1"/>
    </bean>

    Here is below code to create jdbctemplate...

    BasicDataSource bds = (BasicDataSource) ctx.getBean("dataSource");
    bds.setUrl("jdbc:mysql://address=(protocol=tcp)(host=xx.xx.xx.xx)(port=3306 )/" + db + "?autoreconnect=true);
    JdbcTemplate jt = new JdbcTemplate(bds);

    I searched and this the url suggested to connect to IPv6 address. I am able to connect thro DriverManager.getInstance but not thro this datasource....Am i missing anything here

    Exception
    Caused by: java.net.UnknownHostException: address=(protocol=tcp)(host=xx.xx.xx.xx)
    at java.net.InetAddress.getAllByName0(InetAddress.jav a:1215)
    at java.net.InetAddress.getAllByName(InetAddress.java :1127)
    at java.net.InetAddress.getAllByName(InetAddress.java :1063)
    at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:243)
Working...
X