This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to connect Sybase using real ip

 
hesham katon
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

when i am working using localhost, it works fine

String MM_bassami_DRIVER = "com.sybase.jdbc3.jdbc.SybDriver";
String MM_bassami_USERNAME = "dba";
String MM_bassami_PASSWORD = "sql";
String database="myDB";
String MM_bassami_STRING = "jdbc:sybase:Tds:localhost:2638";

Driver Driverrs_news = (Driver)Class.forName(MM_bassami_DRIVER).newInstance();
Connection Connrs_news = DriverManager.getConnection(MM_bassami_STRING,MM_bassami_USERNAME,MM_bassami_PASSWORD);
........

when i place the real ip instead of "localhost" it gives me this error :

java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s)

should i change port number when i use real ip ?

Please Help
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have problems by connecting to sybase using the real ip.

Only in the standaard configuration sybase is on port 5001 did you change that. Also posting your backtrace of your exception would help.

Try 127.0.0.1 instead of localhost, because I believe your sybase server isn't named localhost.
 
hesham katon
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Remko for your reply
i have tried to connect using 127.0.0.1 and it works fine when i try to access the database from the same computer

but it seems the problem only happens when i try to access the database using another computer through the internet

also , my default sybase port here is 2638 , and this port works fine from the same computer

a friend told me that this may be security issue , i stopped the firewall on that computer , but it doesnt work yet

also this may be that database doesn't accept outside connections , but i don't know how to change this configuration

wish anyone can help

thanks in advacne
 
hesham katon
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found out the solution of that problem
i was running the Sybase using "Sybase Central"

but i have to run it using "dbserv8.exe"

when i do that i can access it from my computer here

but i have another problem now when i try to run my application on the hosting company, it gives me this error :
java.sql.SQLException: JZ006: Caught IOException: java.net.ConnectException: Connection timed out

it's very strange, because i can run the same application from my pc here , and it access the same db well

wish anyone can help

thank you so much
 
hesham katon
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a strange thing also happens :

even when i shutdown the database , the same error still occur

Connection timed out

???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic