You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by xianwinwin <xi...@gmail.com> on 2008/09/26 00:35:37 UTC

JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Hi all,

my application runs great on my localhost. now, after all is done, I deploy
the application on a remote site.
so some changes should apply.

on my localhost i have:
<property name="JDBC.ConnectionURL"
value="jdbc:mysql://localhost:3306/my_db"/>


and on the remote I did:
<property name="JDBC.ConnectionURL"
value="jdbc:mysql://69.89.12.165:3306/my_db"/>

but this doesn't work....any suggestions? did I forget anything?

Thank you


* error message:

--- The error occurred in com/persistence/ibatis/SqlMap/email_SqlMap.xml.  
--- The error occurred while executing mapped statement.  
--- Check the email.abatorgenerated_insert.  
--- Check the statement or the result map.  
--- Cause: java.sql.SQLException: No suitable driver found for
jdbc:mysql:/69.89.12.165:3306/itc_registration_db
Caused by: java.sql.SQLException: No suitable driver found for
jdbc:mysql:/69.89.12.165:3306/my_db
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
-- 
View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19679603.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


RE: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by xianwinwin <xi...@gmail.com>.
I just tested this issue with a simple JDBC code (simple select) and it works
just fine! same username / password. this leads to the following
conclusions:

1. Its not a firewall issue
2. the problem is with iBatis configuration.

also consider that the same code works fine when the db is localhost

this is the conf file...i'd appritiate if anyone can point the problem.



<!DOCTYPE sqlMapConfig 
            PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" 
            "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">  
 
<sqlMapConfig>
 
	<settings 	cacheModelsEnabled="false" 
				enhancementEnabled="true" 
				lazyLoadingEnabled="true" 
        		maxRequests="32" 
        		maxSessions="10" 
        		maxTransactions="10" 
        		useStatementNamespaces="true" />
 
	<transactionManager type="JDBC">
    	<dataSource type="SIMPLE">
    	    <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
    	    
    	    
    	    
    	    <property name="JDBC.ConnectionURL"
value="jdbc:mysql://69.89.12.165:3306/my_db"/>
    	    
    	    <property name="JDBC.Username" value="userA"/>
    	    <property name="JDBC.Password" value="apple"/>        	      
        	<property name="Pool.MaximumActiveConnections" value="10"/>
        	<property name="Pool.MaximumIdleConnections" value="5"/>
        	<property name="Pool.MaximumCheckoutTime" value="120000"/>
        	<property name="Pool.TimeToWait" value="10000"/>
        	<property name="Pool.PingQuery" value="select * from
dbname.tablename"/>
        	<property name="Pool.PingEnabled" value="true"/>
        	<property name="Pool.PingConnectionsOlderThan" value="5"/>
        	<property name="Pool.PingConnectionsNotUsedFor" value="5"/>
    	</dataSource>
	</transactionManager>
		
	<sqlMap resource="com/persistence/ibatis/SqlMap/client_SqlMap.xml" />	
	
</sqlMapConfig>

THANKS FOR ANY POINTERS
-- 
View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19713181.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


RE: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by Poitras Christian <Ch...@ircm.qc.ca>.
Could the username or password be wrong or not used correctly by the datasource?
Or maybe the username does not have access to the database...

Christian

-----Original Message-----
From: xianwinwin [mailto:xianwinwin@gmail.com]
Sent: Friday, September 26, 2008 4:52 PM
To: user-java@ibatis.apache.org
Subject: Re: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'



Starting Nmap 4.53 ( http://insecure.org ) at 2008-09-26 16:48 EDT

Interesting ports on h-69.89.12.165.nycmny83.covad.net (69.89.12.165):

PORT     STATE SERVICE

3306/tcp open  mysql







Larry Meadors wrote:
>
> Firewall, maybe?
>
> nmap -P0 -p 3306 69.89.12.165
>
> Larry
>
>
> On Fri, Sep 26, 2008 at 9:07 AM, xianwinwin <xi...@gmail.com> wrote:
>>
>> mmm.....no, that's not the reason (though good catch!)
>>
>> I double checked the code is:
>>
>>
>> <property name="JDBC.ConnectionURL"
>> value="jdbc:mysql://69.89.12.165:3306/my_db"/>
>>
>>
>> and the error message is:
>>
>>
>>
>> --- Cause: com.mysql.jdbc.CommunicationsException: Communications
>> link failure due to underlying exception:
>>
>> ** BEGIN NESTED EXCEPTION **
>>
>> java.net.SocketException
>> MESSAGE: java.net.ConnectException: Connection refused: connect
>>
>> STACKTRACE:
>>
>> java.net.SocketException: java.net.ConnectException: Connection refused:
>> connect
>>        at
>> com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
>> va:156)
>> --
>> View this message in context:
>> http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27loc
>> alhost%27-to-%27IP-number%27-tp19679603p19690286.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19696187.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by xianwinwin <xi...@gmail.com>.

Starting Nmap 4.53 ( http://insecure.org ) at 2008-09-26 16:48 EDT

Interesting ports on h-69.89.12.165.nycmny83.covad.net (69.89.12.165):

PORT     STATE SERVICE

3306/tcp open  mysql







Larry Meadors wrote:
> 
> Firewall, maybe?
> 
> nmap -P0 -p 3306 69.89.12.165
> 
> Larry
> 
> 
> On Fri, Sep 26, 2008 at 9:07 AM, xianwinwin <xi...@gmail.com> wrote:
>>
>> mmm.....no, that's not the reason (though good catch!)
>>
>> I double checked the code is:
>>
>>
>> <property name="JDBC.ConnectionURL"
>> value="jdbc:mysql://69.89.12.165:3306/my_db"/>
>>
>>
>> and the error message is:
>>
>>
>>
>> --- Cause: com.mysql.jdbc.CommunicationsException: Communications link
>> failure due to underlying exception:
>>
>> ** BEGIN NESTED EXCEPTION **
>>
>> java.net.SocketException
>> MESSAGE: java.net.ConnectException: Connection refused: connect
>>
>> STACKTRACE:
>>
>> java.net.SocketException: java.net.ConnectException: Connection refused:
>> connect
>>        at
>> com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
>> --
>> View this message in context:
>> http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19690286.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19696187.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by Larry Meadors <la...@gmail.com>.
Firewall, maybe?

nmap -P0 -p 3306 69.89.12.165

Larry


On Fri, Sep 26, 2008 at 9:07 AM, xianwinwin <xi...@gmail.com> wrote:
>
> mmm.....no, that's not the reason (though good catch!)
>
> I double checked the code is:
>
>
> <property name="JDBC.ConnectionURL"
> value="jdbc:mysql://69.89.12.165:3306/my_db"/>
>
>
> and the error message is:
>
>
>
> --- Cause: com.mysql.jdbc.CommunicationsException: Communications link
> failure due to underlying exception:
>
> ** BEGIN NESTED EXCEPTION **
>
> java.net.SocketException
> MESSAGE: java.net.ConnectException: Connection refused: connect
>
> STACKTRACE:
>
> java.net.SocketException: java.net.ConnectException: Connection refused:
> connect
>        at
> com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
> --
> View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19690286.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by xianwinwin <xi...@gmail.com>.
mmm.....no, that's not the reason (though good catch!)

I double checked the code is:


<property name="JDBC.ConnectionURL"
value="jdbc:mysql://69.89.12.165:3306/my_db"/> 


and the error message is:



--- Cause: com.mysql.jdbc.CommunicationsException: Communications link
failure due to underlying exception: 

** BEGIN NESTED EXCEPTION ** 

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused:
connect
	at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
-- 
View this message in context: http://www.nabble.com/JDBC.ConnectionURL-problem.-Changed-from-%27localhost%27-to-%27IP-number%27-tp19679603p19690286.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: JDBC.ConnectionURL problem. Changed from 'localhost' to 'IP-number'

Posted by Larry Meadors <la...@gmail.com>.
Cause: java.sql.SQLException: No suitable driver found for
jdbc:mysql:/69.89.12.165:3306/itc_registration_db

Looks like you are missing a / there.

Larry