Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connect to topspeed data base and java

 
mesbah yahia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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.

 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 = "jdbcdbc: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 Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Mark post as helpful
  • send pies
  • 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= "jdbcdbc: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 Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for letting us know the solution, this could be helpfull to somebody else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic