Solved

Question about using jConnect for JDBC!

Posted on 2001-06-07
2
324 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
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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordappend challenge 8 85
create a gui in perl 3 45
ArrayIndexOutOfBoundException 9 33
Java Server Faces parameter pass? 6 22
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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:
This video teaches viewers about errors in exception handling.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now