[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Question about using jConnect for JDBC!

Posted on 2001-06-07
2
Medium Priority
?
356 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

649 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