Ray Y
Member
So, I have a very limited knowledge of Java, so maybe someone has already done this and will save me the trouble of trial and error on my part. Assistance is greatly appreciated.
I see references and examples here to using JDBC to connect to "any" database, but then all the postings show a SQL database and/or using subsequent SQL statements.
I would like to connect to a non-SQL database (here called "qm"). I have a vendor-supplied JDBC .jar file. It exposes database specific commands - not SQL statements. The (my simplified) example they give for using it is:
import qmclient.*;
import java.io.*;
class ex
{
private static qmclient qm;
public static void main(String[] args) throws IOException
{
int fSales; // SALES file
String SaleRec; // SALES record
qm = new qmclient();
if (!qm.ConnectLocal("demo"))
{
System.out.println("Failed to connect to server: "+ qm.Error);
return;
}
// Open files
fSales = qm.Open("SALES");
if (fSales == 0)
{
System.out.println("Cannot open SALES file");
return;
}
SaleRec = qm.Read(fSales, "1234");
.
.
.
So, the qmclient is the database pure-java driver, and the ConnectLocal, Open, Read, etc are all API specific to this database.
Obviously, my question is: how do I implement this in B4J?
I get including the #AdditionalJar line, but how do I associate my database object in B4J to it? Not Private qm as SQL as in the examples posted here, since this isn't a SQL driver.
I'm obviously missing something probably pretty obvious...
I see references and examples here to using JDBC to connect to "any" database, but then all the postings show a SQL database and/or using subsequent SQL statements.
I would like to connect to a non-SQL database (here called "qm"). I have a vendor-supplied JDBC .jar file. It exposes database specific commands - not SQL statements. The (my simplified) example they give for using it is:
import qmclient.*;
import java.io.*;
class ex
{
private static qmclient qm;
public static void main(String[] args) throws IOException
{
int fSales; // SALES file
String SaleRec; // SALES record
qm = new qmclient();
if (!qm.ConnectLocal("demo"))
{
System.out.println("Failed to connect to server: "+ qm.Error);
return;
}
// Open files
fSales = qm.Open("SALES");
if (fSales == 0)
{
System.out.println("Cannot open SALES file");
return;
}
SaleRec = qm.Read(fSales, "1234");
.
.
.
So, the qmclient is the database pure-java driver, and the ConnectLocal, Open, Read, etc are all API specific to this database.
Obviously, my question is: how do I implement this in B4J?
I get including the #AdditionalJar line, but how do I associate my database object in B4J to it? Not Private qm as SQL as in the examples posted here, since this isn't a SQL driver.
I'm obviously missing something probably pretty obvious...