?
Solved

Question about using jConnect for JDBC!

Posted on 2001-06-07
2
Medium Priority
?
350 Views
Last Modified: 2012-06-21
I want to connect sybase using jconnec.
I have downloaded jconnect4.2(5.2),and importing all the class to visual age.
I write the code like:
public void initdb(String url, String user, String passwd) {
     
     try {
     Class.forName( "com.sybase.jdbc.SybDriver" );
     }
     catch( Exception e ){
     // do something if couldn't load it
          System.err.println(e.getMessage());
     }


     try{
          String ur = "jdbc:sybase:Tds:Server:5000";
          String userid = "sa";
          String pwd = "111111";

     sybaseCon = DriverManager.getConnection   (ur,userid,pwd);
               
     }
     catch(SQLException e){
     System.err.println("Conn fail");
     System.err.println(e.getMessage());
     System.exit(2);
    }
}
"Server" is the name of remote sybase server name;
but I get the output result:
com.sybase.jdbc.SybDriver
Conn fail
No suitable driver

what is wrong?
0
Comment
Question by:Troublesth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
q2eddie earned 400 total points
ID: 6499816
Hi, Troublesth.

I have only a little experience with Java, but I understand enough of this to maybe help you a little bit.

Note: If you have already solved this problem, then delete this question.

#Try This
1. SQLException: No suitable driver
Source: http://webforums.sybase.com (via google)

If you have spaces in your path to jConnect, make sure you enclose your classpath in quotes.

Also, make sure you are using jConnect 4.x if you are using [com.sybase.jdbc.SybDriver].

[com.sybase.jdbc2.jdbc.SybDriver] is what you use with jConnect 5.x and requires jconn2.jar in your classpath.

#Links
1. "Programmer's Reference jConnect for JDBC - Setting up jConnect"
http://manuals.sybase.com/onlinebooks/group-jc/jcg0550e/prjdbc/@Generic__BookTextView/522
(Look near the bottom below the table.)

Bye. -e2
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 8898933


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


-- Points to q2eddie


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question