Forums Register Login

Accessing Sybase using JDBC from an Applet

+Pie Number of slices to send: Send
Hi,
I created a code for an applet that accesses Sybase database usind DSN. But when I post it in a web server I could not access any thing due to the JDBC connectivity.
I believe DSN is for only stand alone systems and not for applets running in a web server. I found out that I can user JConnect to access the syabase database. I went to sybase website but could not find a real good explanation. Please can anybody tell me how to access sybase database using Jacconet.
Could you please tell me is there any other alternative to access database using the applet running in a webpage. It should help anybody accessing the webpage to access the database..
Thanks
Preeth
+Pie Number of slices to send: Send
The JConnect works fine for the applet. We need to install Jconnect and set path.
import the following file:
import com.sybase.jdbcx.*
establsih connection using the following code:
Driver specification:
Class c=Class.forName("com.sybase.jdbc.SybDriver");
sybDriver=(SybDriver)c.newInstance();
DriverManager.registerDriver((Driver)sybDriver);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
establish connecction using:
Connection con=DriverManager.getConnection("jdbc:sybase:Tds :phoenix:5795","id","pwd");
This will help you to connect to sybase database from JAVA wihtout using DSN
[This message has been edited by Thomas Paul (edited November 21, 2000).]
+Pie Number of slices to send: Send
Actually, you only need:
Class.forName("com.sybase.jdbc.SybDriver");
Connection con=DriverManager.getConnection("jdbc:sybase:Tds:Phoenix:5795","id","pwd");
The problem may be that the browser is not going to let you create a connection to a database that is on a different server than the one where the applet was loaded from. If that is the case, then you will need to look at other possibilities such as Applet-Servlet communication.
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 769 times.
Similar Threads
Server-side JavaScript doubt - database connectivity
Here is a tough one.....
Access denied Error
Registering Sybase driver
Please Help!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:14:53.