You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Loughran <st...@apache.org> on 2008/03/25 17:25:28 UTC

Re: ant sql doesn't recognize the database server name with back slash?

Chaohua Wang wrote:
> Hi Folks,
> 
> I am using jdbc driver to connect database. I have 2 database. The url
> is like this 10.23.23.1, another one is 10.23.23.2\sql5t9.
> I am using jtds drvie  to connect: jdbc:jtds:sqlserver://10.23.23.1  it
> works fine. 
> But for 10.23.23.2\sql5t9,  is not working. message shows:
> java.sql.SQLException: Unknown server host name '10.23.23.2\sql5t9'.
> Could you tell what is reason why? Thank you 

Its up to the driver how it handles URLS; ant just loads the specific 
driver and calls driver.connect(URL). If the driver is rejecting it, it 
musnt support backslashes. Given the requirement to be a URL, which 
means with forward slashes, this isn't that surprising.

-steve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: ant sql doesn't recognize the database server name with back slash?

Posted by Chaohua Wang <cw...@incomm.com>.
Thank you, '10.23.23.2\sql5t9' sql5t9 is a name instance, If I use
forward slash, sql5t9 will be treated as a Database name, instead of
name instance.
In this way, 10.23.23.2 can be recognized, but it is not
'10.23.23.2\sql5t9', so I will get login failed issue.
Do I need to track database? I can use  '10.23.23.2\sql5t9' as server
name to login in with my password in Toad. 


-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org] 
Sent: Tuesday, March 25, 2008 10:25 AM
To: Ant Users List
Subject: Re: ant sql doesn't recognize the database server name with
back slash?

Chaohua Wang wrote:
> Hi Folks,
> 
> I am using jdbc driver to connect database. I have 2 database. The url
> is like this 10.23.23.1, another one is 10.23.23.2\sql5t9.
> I am using jtds drvie  to connect: jdbc:jtds:sqlserver://10.23.23.1
it
> works fine. 
> But for 10.23.23.2\sql5t9,  is not working. message shows:
> java.sql.SQLException: Unknown server host name '10.23.23.2\sql5t9'.
> Could you tell what is reason why? Thank you 

Its up to the driver how it handles URLS; ant just loads the specific 
driver and calls driver.connect(URL). If the driver is rejecting it, it 
musnt support backslashes. Given the requirement to be a URL, which 
means with forward slashes, this isn't that surprising.

-steve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant sql doesn't recognize the database server name with back slash?

Posted by Steve Loughran <st...@apache.org>.
Chaohua Wang wrote:
> I have figured out, I didn't use name instance, instead port number,
> works fine now. 

excellent!

> 
> -----Original Message-----
> From: Steve Loughran [mailto:stevel@apache.org] 
> Sent: Tuesday, March 25, 2008 10:25 AM
> To: Ant Users List
> Subject: Re: ant sql doesn't recognize the database server name with
> back slash?
> 
> Chaohua Wang wrote:
>> Hi Folks,
>>
>> I am using jdbc driver to connect database. I have 2 database. The url
>> is like this 10.23.23.1, another one is 10.23.23.2\sql5t9.
>> I am using jtds drvie  to connect: jdbc:jtds:sqlserver://10.23.23.1
> it
>> works fine. 
>> But for 10.23.23.2\sql5t9,  is not working. message shows:
>> java.sql.SQLException: Unknown server host name '10.23.23.2\sql5t9'.
>> Could you tell what is reason why? Thank you 
> 
> Its up to the driver how it handles URLS; ant just loads the specific 
> driver and calls driver.connect(URL). If the driver is rejecting it, it 
> musnt support backslashes. Given the requirement to be a URL, which 
> means with forward slashes, this isn't that surprising.
> 
> -steve
> 


-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: ant sql doesn't recognize the database server name with back slash?

Posted by Chaohua Wang <cw...@incomm.com>.
I have figured out, I didn't use name instance, instead port number,
works fine now. 

-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org] 
Sent: Tuesday, March 25, 2008 10:25 AM
To: Ant Users List
Subject: Re: ant sql doesn't recognize the database server name with
back slash?

Chaohua Wang wrote:
> Hi Folks,
> 
> I am using jdbc driver to connect database. I have 2 database. The url
> is like this 10.23.23.1, another one is 10.23.23.2\sql5t9.
> I am using jtds drvie  to connect: jdbc:jtds:sqlserver://10.23.23.1
it
> works fine. 
> But for 10.23.23.2\sql5t9,  is not working. message shows:
> java.sql.SQLException: Unknown server host name '10.23.23.2\sql5t9'.
> Could you tell what is reason why? Thank you 

Its up to the driver how it handles URLS; ant just loads the specific 
driver and calls driver.connect(URL). If the driver is rejecting it, it 
musnt support backslashes. Given the requirement to be a URL, which 
means with forward slashes, this isn't that surprising.

-steve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant sql doesn't recognize the database server name with back slash?

Posted by Rishi Gogia <ri...@hotmail.com>.
so Steve you mean that for picking up the addresses for a local Windows 
machine, we can just give the path with single backward slash? (like 
D:\temp\ant) and it will work?

--------------------------------------------------
From: "Steve Loughran" <st...@apache.org>
Sent: Wednesday, March 26, 2008 3:15 PM
To: "Ant Users List" <us...@ant.apache.org>
Subject: Re: ant sql doesn't recognize the database server name with back 
slash?

> Rishi Gogia wrote:
>> in case of a unix env, URL should be used with forward slashes ('/') 
>> instead of backslashes
>>
>> and in case any string needs to be used backslashes, they need to 
>> accompany another backslash. this is because backslash acts as a escape 
>> sequence character (remember \n)
>>
>> so to avoid such a situation, use "\\". the ant interpreter will 
>> interpret the same as a single "\" and the task will be accomplished
>
> Normally Ant doesn't do that. There are special rules when working with 
> regexp stuff, but there its the java.utils.regex package at work.
>
> -steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant sql doesn't recognize the database server name with back slash?

Posted by Steve Loughran <st...@apache.org>.
Rishi Gogia wrote:
> in case of a unix env, URL should be used with forward slashes ('/') 
> instead of backslashes
> 
> and in case any string needs to be used backslashes, they need to 
> accompany another backslash. this is because backslash acts as a escape 
> sequence character (remember \n)
> 
> so to avoid such a situation, use "\\". the ant interpreter will 
> interpret the same as a single "\" and the task will be accomplished

Normally Ant doesn't do that. There are special rules when working with 
regexp stuff, but there its the java.utils.regex package at work.

-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant sql doesn't recognize the database server name with back slash?

Posted by Rishi Gogia <ri...@hotmail.com>.
in case of a unix env, URL should be used with forward slashes ('/') instead 
of backslashes

and in case any string needs to be used backslashes, they need to accompany 
another backslash. this is because backslash acts as a escape sequence 
character (remember \n)

so to avoid such a situation, use "\\". the ant interpreter will interpret 
the same as a single "\" and the task will be accomplished

Rishi

--------------------------------------------------
From: "Steve Loughran" <st...@apache.org>
Sent: Tuesday, March 25, 2008 9:55 PM
To: "Ant Users List" <us...@ant.apache.org>
Subject: Re: ant sql doesn't recognize the database server name with back 
slash?

> Chaohua Wang wrote:
>> Hi Folks,
>>
>> I am using jdbc driver to connect database. I have 2 database. The url
>> is like this 10.23.23.1, another one is 10.23.23.2\sql5t9.
>> I am using jtds drvie  to connect: jdbc:jtds:sqlserver://10.23.23.1  it
>> works fine. But for 10.23.23.2\sql5t9,  is not working. message shows:
>> java.sql.SQLException: Unknown server host name '10.23.23.2\sql5t9'.
>> Could you tell what is reason why? Thank you
>
> Its up to the driver how it handles URLS; ant just loads the specific 
> driver and calls driver.connect(URL). If the driver is rejecting it, it 
> musnt support backslashes. Given the requirement to be a URL, which means 
> with forward slashes, this isn't that surprising.
>
> -steve
>
> -- 
> Steve Loughran                  http://www.1060.org/blogxter/publish/5
> Author: Ant in Action           http://antbook.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org