Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connecting Sybase to a localhost

843859Oct 28 2008 — edited Nov 20 2014
Hi, I'm currently working on a project that requires me to use Sybase and JSP and starting from scratch and learning from scratch as well.

However, I am unable to connect my website to my own computer, meaning, the database (Sybase in this case) is loaded in my computer,
but I cannot connect my website to access the local database.

Currently, I have this:

Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
Connection connection=DriverManager.getConnection("jdbc:sybase:Tds:localhost:/course","dba","sql");
Statement statement=connection.createStatement();


to establish a connection to my local server.
However, when i click on the site to try and connect to the server, all i get is a whole page of code.

What is wrong with the code above?
and lets say I want to upload the database and the site, where can I do it?


any help will be greatly appreciated.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2008
Added on Oct 28 2008
16 comments
363 views