dbTalk Databases Forums  

jdbc:odbc in JBuilder

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss jdbc:odbc in JBuilder in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thom Lamb [ISUG]
 
Posts: n/a

Default jdbc:odbc in JBuilder - 12-04-2003 , 08:22 PM






I am trying to do a simple connection in JBuilder to a ASA 8 DB:

CLASSPATH=C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar
---------
import java.sql.*;

static public void main(String[] args) {
try {
Class.forName("ianywhere.ml.jdbcodbc.IDriver");
} catch (java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException:");
System.err.println(e.getMessage());
}

Connection conn;
try {
String url = "jdbcdbc:dbn=exLibrisDB";
conn = DriverManager.getConnection(url, "dba", "sql");
System.err.println("Hello World");
} catch (SQLException e) {
System.err.print("SQLException:");
System.err.println(e.getMessage());
}
....
}
----------------------------
Error Messages:
C:\JBuilder9\jdk1.4\bin\javaw -classpath "C:\JBuilder9\samples\Welcome
\classes;C:\JBuilder9\lib\dx.jar;C:\JBuilder9\lib\ beandt.jar;C:\JBuilder9
\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilder9 \jdk1.4\demo\plugin\jfc
\Java2D\Java2Demo.jar;C:\JBuilder9\jdk1.4\jre\lib\ charsets.jar;C:
\JBuilder9\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilde r9\jdk1.4\jre\lib\ext
\ldapsec.jar;C:\JBuilder9\jdk1.4\jre\lib\ext\local edata.jar;C:\JBuilder9
\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilde r9\jdk1.4\jre\lib\im
\indicim.jar;C:\JBuilder9\jdk1.4\jre\lib\jaws.jar; C:\JBuilder9\jdk1.4\jre
\lib\jce.jar;C:\JBuilder9\jdk1.4\jre\lib\jsse.jar; C:\JBuilder9\jdk1.4\jre
\lib\rt.jar;C:\JBuilder9\jdk1.4\jre\lib\sunrsasign .jar;C:\JBuilder9
\jdk1.4\lib\dt.jar;C:\JBuilder9\jdk1.4\lib\htmlcon verter.jar;C:\JBuilder9
\jdk1.4\lib\tools.jar" com.borland.samples.welcome.WelcomeApp
ClassNotFoundException:ianywhere.ml.jdbcodbc.IDriv er

SQLException:No suitable driver



I am wondering why it can't find ianywhere.ml.jdbcodbc.IDriver

and why C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar
doesn't show up in the ClassPath.

Reply With Quote
  #2  
Old   
Chris Keating \(iAnywhere Solutions\)
 
Posts: n/a

Default Re: jdbc:odbc in JBuilder - 12-04-2003 , 09:45 PM






You have not given enough information to connect. The key missing item is
which ODBC driver to use.

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

************************************************** **************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

************************************************** **************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

************************************************** **************************
*

"Thom Lamb [ISUG]" <thom (AT) isug (DOT) com> wrote

Quote:
I am trying to do a simple connection in JBuilder to a ASA 8 DB:

CLASSPATH=C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar
---------
import java.sql.*;

static public void main(String[] args) {
try {
Class.forName("ianywhere.ml.jdbcodbc.IDriver");
} catch (java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException:");
System.err.println(e.getMessage());
}

Connection conn;
try {
String url = "jdbcdbc:dbn=exLibrisDB";
conn = DriverManager.getConnection(url, "dba", "sql");
System.err.println("Hello World");
} catch (SQLException e) {
System.err.print("SQLException:");
System.err.println(e.getMessage());
}
...
}
----------------------------
Error Messages:
C:\JBuilder9\jdk1.4\bin\javaw -classpath "C:\JBuilder9\samples\Welcome
\classes;C:\JBuilder9\lib\dx.jar;C:\JBuilder9\lib\ beandt.jar;C:\JBuilder9
\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilder9 \jdk1.4\demo\plugin\jfc
\Java2D\Java2Demo.jar;C:\JBuilder9\jdk1.4\jre\lib\ charsets.jar;C:
\JBuilder9\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilde r9\jdk1.4\jre\lib\ext
\ldapsec.jar;C:\JBuilder9\jdk1.4\jre\lib\ext\local edata.jar;C:\JBuilder9
\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilde r9\jdk1.4\jre\lib\im
\indicim.jar;C:\JBuilder9\jdk1.4\jre\lib\jaws.jar; C:\JBuilder9\jdk1.4\jre
\lib\jce.jar;C:\JBuilder9\jdk1.4\jre\lib\jsse.jar; C:\JBuilder9\jdk1.4\jre
\lib\rt.jar;C:\JBuilder9\jdk1.4\jre\lib\sunrsasign .jar;C:\JBuilder9
\jdk1.4\lib\dt.jar;C:\JBuilder9\jdk1.4\lib\htmlcon verter.jar;C:\JBuilder9
\jdk1.4\lib\tools.jar" com.borland.samples.welcome.WelcomeApp
ClassNotFoundException:ianywhere.ml.jdbcodbc.IDriv er

SQLException:No suitable driver



I am wondering why it can't find ianywhere.ml.jdbcodbc.IDriver

and why C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar
doesn't show up in the ClassPath.



Reply With Quote
  #3  
Old   
Thom Lamb [ISUG]
 
Posts: n/a

Default Re: jdbc:odbc in JBuilder - 12-05-2003 , 01:11 PM



Chris,

Before I can get to the ODBC Driver issue don't I need to address:

ClassNotFoundException:ianywhere.ml.jdbcodbc.IDriv er

I've looked in the ASA help under the JDBC ODBC Bridge information and
can't find any examples of what I need. Do you have any? I'm using ASA
v8.

Thanks,
Thom Lamb

"Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating (AT) iAnywhere (DOT) com>
wrote in news:3fcfff51@forums-1-dub:

Quote:
You have not given enough information to connect. The key missing item is
which ODBC driver to use.



Reply With Quote
  #4  
Old   
Thom Lamb [ISUG]
 
Posts: n/a

Default Re: jdbc:odbc in JBuilder - 12-05-2003 , 01:40 PM



Chris,

BTW, I am using JBuilder 9 Personal.

Thanks

"Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating (AT) iAnywhere (DOT) com>
wrote in news:3fcfff51@forums-1-dub:

Quote:
You have not given enough information to connect. The key missing item is
which ODBC driver to use.



Reply With Quote
  #5  
Old   
Greg Fenton
 
Posts: n/a

Default Re: jdbc:odbc in JBuilder - 12-06-2003 , 12:21 AM



Thom Lamb [ISUG] wrote:
Quote:
I am trying to do a simple connection in JBuilder to a ASA 8 DB:
Are you trying to create a connection for MobiLink? If not, then the
class "ianywhere.ml.jdbcodbc.IDriver" is likely not what you want to use.


Quote:
CLASSPATH=C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar
This may be set in your environment, but is it set in your JBuilder
project? According to the classpath being dumped out in the error
message, it apparently isn't. This is a JBuilder configuration issue.

Quote:
I am wondering why it can't find ianywhere.ml.jdbcodbc.IDriver

If you look in %ASANY9%\java, you will find a number of JAR and ZIP
files relating to Java and ASA. jodbc.jar contains the above class, but
be sure this class is really what you are looking for.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/



Reply With Quote
  #6  
Old   
Nate Dogg
 
Posts: n/a

Default Re: jdbc:odbc in JBuilder - 12-12-2003 , 03:27 PM



Aside from the already noticed pathing problem you are probably more
interested in the following class:
forName("com.sybase.jdbc2.jdbc.SybDriver")

That might work better for you.. depending on what you are trying to do..
-Nate

"Greg Fenton" <greg.fenton_NOSPAM_ (AT) ianywhere (DOT) com> wrote

Quote:
Thom Lamb [ISUG] wrote:
I am trying to do a simple connection in JBuilder to a ASA 8 DB:

Are you trying to create a connection for MobiLink? If not, then the
class "ianywhere.ml.jdbcodbc.IDriver" is likely not what you want to use.



CLASSPATH=C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar

This may be set in your environment, but is it set in your JBuilder
project? According to the classpath being dumped out in the error
message, it apparently isn't. This is a JBuilder configuration issue.


I am wondering why it can't find ianywhere.ml.jdbcodbc.IDriver


If you look in %ASANY9%\java, you will find a number of JAR and ZIP
files relating to Java and ASA. jodbc.jar contains the above class, but
be sure this class is really what you are looking for.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.