Solved

Question about using jConnect for JDBC!

Posted on 2001-06-07
2
346 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 100 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

691 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