File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Java and Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java and Sybase" Watch "Java and Sybase" New topic
Author

Java and Sybase

Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Hi,
In my project for the development of the new module, SYBASE is the database that is being used.
Since this is going to be my first SYBASE project, I have a doubt about the "jdbc driver" for SYBASE.
Once we install Oracle client in our machines, the classes12.zip file comes along with Oracle installation.
Similiarly will the SYBASE driver be available once we install SYBASE ?
Our sybase database exists remotely so I havent yet got a chance to look at the installation..
Please hhelp me in this case..
Thanks
Maya
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
Sybase drivers can be found here.
There's documentation and downloads for the JConnect driver.
One thing I ran into was my connection to the database timed out and I had to re-create it when that happened. That's configurable at the database level though.


Greg Ostravich - SCPJ2
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Greg,
Thanks for that link..
BTW, When we install Sybase, does this driver come along with it or do we need to buy the driver seperately from Sybase ?
We do have Sybase database..
Please let me know
Thanks
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Also,
Is this freely downloadable ?
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
It looks like it's a free download.
If you have Sybase already give it a try.
I don't know if it comes with Sybase -- sorry I didn't say that in my first post.
In my case, I borrowed the driver from somebody else on the team and didn't know to check the Sybase website to download it. I only realized that recently when I found the Microsoft SQL Server 2000 drivers on their site. It makes sense that vendors would want you to use their database technology and would provide JDBC drivers to their databases.
Other vendors provide competing drivers for some databases too. For example, there were other vendors offering competing JDBC drivers for MS SQL Server 2000 that I found while researching BLOB use in the JDBC for SQL Server.
By the way - depending on how you're using the driver beware of classpath issues. I ran into problems finding the right place to store my JAR. Once I found where the JConnect Jar went everything worked OK.
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Sure, I shall check the directory when I install the driver.
Thanks so much for your wonderful help.
BTW, do you want to share with me the classpath ?
I have sybase database on a remote machine and I am going to install the driver on my machine..
Thanks
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
Sorry
I don't remember the classpath I used and even if I did it was specific to O'Reilly's WebSite product and might not have worked for your environment.
My JDBC driver for Sybase was being used from an Applet served from an O'Reilly WebSite web server. I think it was a 'lib' or 'class' directory where all Java class files resided but you'll really need to check your documentation for your situation.
If you're using JDBC from Java as an Application, not an Applet or J2EE usage then you probably just need to have the JConnect JAR in your classpath where you probably have other JARs used by your code.
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
I want to use JDBC in J2EE and in a servlet..
Also, as we have Oracle client, does Sybase offer a Sybase client to get connected to a remote database ?
Thanks
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
You should be able to create a connection directly to your Sybase database using JConnect.
In my example, I had to use TDS and Tunnel my requests underneath because I was running as an Applet and my Sybase SQL Server ran on a different box than the web server that served my content.
If you're interested in this, the documentation on Sybase's site explains how to do this.
I'm guessing that you should be able to deploy your JConnect jar to wherever you deploy classes used by your servlets.
Look at the newgroups listed at the link I listed.
That might be helpful too.
Here's another link that describes JDBC, JConnect, and usage.
[ September 05, 2002: Message edited by: Greg Ostravich ]
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Greg,
Thanks so much!! Your help is really appreciated.
My question regarding Sybase clien twas not for access thru JDBC, its a general question. May be I should diect it to the user grp which you suggestted..
My question, in a more descriptive way is,
For getting connection to a Sybase database are there any sybase clients avaialble ? (This is like SQL Plus for Oracle...),
Thanks
Maya
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
I didn't understand the question about getting a connection to a Sybase database and Sybase Clients available. Are you talking about things like SQL Advantage that are user-interfaces to run SQL Queries to check against your DB?
What's SQL Plus for Oracle?
[ September 05, 2002: Message edited by: Greg Ostravich ]
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
SQL Plus is the Application development Tool ( For running our queries for Oracle.). When e install Oracle, this comes up as Application development tool and there will be other configuration tools..
Thanks
Maya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java and Sybase