Solved

Question about using jConnect for JDBC!

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse java  build path 6 59
Java Loop 6 62
Java SE 8u111  Lot of stuff broke 11 71
print map entry 34 69
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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

832 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