File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes connect to topspeed data base and java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connect to topspeed data base and java " Watch "connect to topspeed data base and java " New topic
Author

connect to topspeed data base and java

mesbah yahia
Greenhorn

Joined: Mar 19, 2012
Posts: 7
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

Joined: Oct 21, 2008
Posts: 1107

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

Joined: Mar 19, 2012
Posts: 7
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

Joined: Oct 21, 2008
Posts: 1107

I meant all of the exception, not just the first line
so instead of


you want
mesbah yahia
Greenhorn

Joined: Mar 19, 2012
Posts: 7

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

Joined: Oct 21, 2008
Posts: 1107

Thanks for letting us know the solution, this could be helpfull to somebody else.
 
Consider Paul's rocket mass heater.
 
subject: connect to topspeed data base and java
 
Similar Threads
help reuired in jdbc connection
Problem connecting to database
connetion java and topspeed database
Getting 405 resource not allowed error in WebLogic server help!!!
Topspeed INSERT statement issue