• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

unable to connect Sybase using real ip

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a strange thing also happens :

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

Connection timed out

???
 
mooooooo ..... tiny ad ....
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic