Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connetion java and topspeed database

 
mesbah yahia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, i need your help

I don't use clarion, my project object is using java to acces to Topspeeddatabase which is created before,

i need to know how to connect java to topspeed database.

source code :
Class.forName("what is the class name??");

Cnx = DriverManager.getConnection(url,user,paswd);

thank you.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i did a quick search and this might be usefull:
http://www.rgagnon.com/javadetails/java-0107.html
 
mesbah yahia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your post,

i know how to connect java to other database (oracle ,postgres...ect) my problem is how to connect it to topspeed database,

in your link i find this :

Driver d = (Driver)Class.forName
("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

with what i have to replace the class name :sun.jdbc.odbc.JdbcOdbcDriver to connect to topspeed database.

thnak you.

 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the other thread in which you posted identical question. That thread mentions that there is no specific driver for TopSpeed, and therefore you need to use JDBC-ODBC bridge.

Wendy has provided you with a page which shows what to put into the Class.forName call to use ODBC. The thread I already mentioned seems to contain other info you could find useful.
 
mesbah yahia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank's for your replay,

i read all the thread and i did the same thing but i still got the same error : [error connexion null ]

here is my source code:

try {

Driver d = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
url = "jdbc:odbc:base2"; // is the data source systeme (soft velocity topspeed driver "version 4.0") like 41.3 in http://www.jmdoudoux.fr/java/dej/chap-jdbc.htm
user="base2";
paswd="azerty";
Cnx = DriverManager.getConnection(url,user,paswd);

req= "select * from base1"; // name of the TPS file (base1 is protected by password and contain a list of tables ) //

res = st.executeQuery(req);



}catch (Exception e){
JOptionPane.showMessageDialog(null, "erreur de connexion \n"+e.getMessage());
}

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic