Hey Juergen
this how I was connecting to InstantDB using CocoBase:
I just point my classpath to the cocobase classes, and include the latest
Instant db jar.
here is some example code I used:
<snip>
myBase
= CocoDriver.getCocoDriver( section.getString("classpath"),
section.getString("driver"),
section.getString("connect"),
section.getString("user"),
section.getString("password"));
//to see output
myBase.setDebug(true);
if(myBase.connect() == -1) {
System.out.println("Failed connect!");
}
</snip>
Then to use, for example for looking up a person by name:
<snip>
try {
Person person = new Person();
person.setLogin(username);
Vector foundPerson = getCocoDriver().selectAll(person);
return (Person)foundPerson.firstElement();
} catch(Exception ex) {
}
</snip>
Hope this helps,
joe
Juergen Roeder wrote:
Hi!Is
anybody out there working with CocoBaseFreeJDBC?I'm
working with InstantDB 3.20 beta2 and CocoBaseFreeJDBC 3.01. If I try to
open a new db connection with the CocoAdmin Tool I get the following error
message: "Bad JDBC
ClassName! CocoBase Free only works with InstantDB or SimpleText!" It
seems that CocoBaseFreeJDBC is shipped with InstantDB v2.20 and all the
properties files in the cocobase demos subdirectory rely on version 2.20
of InstantDB.I substituted
all InstantDB v2.20 jars shipped with cocobase by InstantDB v3.20 beta2
jars and edited all the necessary properties files to work with InstantDB
v3.20 beta2. I set idb.jar properly in the CLASSPATH too. Any
idea what's going wrong? Thanks
for help in advance!Jürgen
|