• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connect to topspeed data base and java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

i tried to acces to a topspeed files (.TPS) with java:

i can connect to the file wich don't have password and no multiple metadata with this code source:

but when i try to connect to other .tps wich contain password and multiple metadata (info of person, info of contrat , info of object contrat) with (source2) i get an error message : table not found
source 2:

question: how to introduce the password of data and how to acces to diffrent metadata (info person, info of contart, info of object contrat) in the TPS file with sql request.

please help me.

 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you post the whole stack trace, it really does make things easier, as there is often helpfull information in the nested exceptions
and please use code tags, even if your code is only little snippets
 
mesbah yahia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:can you post the whole stack trace, it really does make things easier, as there is often helpfull information in the nested exceptions
and please use code tags, even if your code is only little snippets



hello wendy,
this is my whole code:


private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
try {


Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
url = "jdbc:odbc:avmp;password='assuarance'";

Cnx = DriverManager.getConnection(url);


st = Cnx.createStatement();

req= " SELECT * from base ";


dt= new DefaultTableModel();
dt.addColumn("nom");
dt.addColumn("prénom");
dt.addColumn("mat");

table.setModel(dt);

while(res.next()){

nom= res.getString(1);
objet = res.getString(2);
number = res.getInt(3); // la même chose

Object[] stg = {nom,objet,number};
dt.addRow(stg);
}




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

}
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant all of the exception, not just the first line
so instead of


you want
 
mesbah yahia
Greenhorn
Posts: 7
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

thank you for your help,

i solved my problem and this is the soluion (source code) :

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
url= "jdbc:odbc:avmp; pasword= 123456";
Cnx = DriverManager.getConnection(url);
st = Cnx.createStatement();

req= " select * from DATA_PERSON ";

res = st.executeQuery(req);

notes:
avmp :is topspeed datasource name

DATA_PERSON : is a table from a multi-file table.

we d'ont need special caracter in the query.


 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for letting us know the solution, this could be helpfull to somebody else.
 
Greenhorn
Posts: 1
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, you saved my life !!!
reply
    Bookmark Topic Watch Topic
  • New Topic