Ok that is true for a Turbine Application.
But how would you start when using a Swing Frontend and the Peer Framework
as the backend. Here is the code for testing but the connection to Informix
failes.
//Version:
//Copyright: Copyright (c) 1999
//Autor: Roland Ettema
//Firma: Debis GmbH
//Beschreibung: Ihre Beschreibung
package icb.ett_testclient;
// Java Packages
import java.util.Vector;
import java.util.Iterator;
// ICB Packages
import icb.om.peer.ActvnPeer;
// Apache Packages
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.util.db.map.DatabaseMap;
import org.apache.turbine.util.db.map.ColumnMap;
import org.apache.turbine.util.db.pool.DBConnection;
import org.apache.turbine.services.db.PoolBrokerService;
// Or should I use DBInformix instead DBConnection
// import org.apache.turbine.util.db.adapter.DBInformix;
public class TestClient {
public TestClient() {
}
public static void main(String[] args) {
TestClient testClient = new TestClient();
testClient.invokedStandalone = true;
try {
System.out.println("Get a connection");
DBConnection db = PoolBrokerService.getInstance().getConnection(
new String("com.informix.jdbc.IfxDriver"),
new
String("jdbc:informix-sqli://53.50.1.32:1693:informixserver=ach807_et_27s;da
tabase=host"),
new String("icbadmin"),
new String("tasskaff"));
System.out.println("Create Criteria");
Criteria crit = new Criteria();
System.out.println("Try to do a doSelect");
Vector v = ActvnPeer.doSelect(crit);
System.out.println("Get Iterator from Vector");
Iterator it = v.iterator();
while (it.hasNext()){
System.out.println(it.next().toString());
}
System.out.println("Release Connection");
PoolBrokerService.getInstance().releaseConnection(db);
} catch (Exception ex)
{
System.out.println(new String("Exception occured"));
System.out.println(ex.getMessage());
}
}
private boolean invokedStandalone = false;
}
-----Urspr�ngliche Nachricht-----
Von: Jon Stevens [mailto:[EMAIL PROTECTED]]
Gesendet am: Mittwoch, 22. November 2000 07:02
An: Turbine
Betreff: Re: Application question
on 11/21/2000 9:37 PM, "Ettema, Roland" <[EMAIL PROTECTED]> wrote:
> - How does the Peer Framework use the database connection and how can I
> use it in an application [db connection tools, and the peer framework]
>
> - In other words how must i set up the DB connection in an Application
using
> the
> Turbine Framework to use the Peer funktionality.
The Peer framework uses Turbine's DBConnection pool internally. You don't
have to worry about DB connections. All you need to do is setup your
TurbineResources.properties file properly.
-jon
--
twice of not very much is still a lot more than not very much
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]