Re: non-JDBC/ODBC interface to MySQL 4.1?



"Frank" <franklopez2000@xxxxxxxxx> wrote in message
news:1144941730.138876.226160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Does anyone know if there is a free, high-quality, non-ODBC/JDBC
interface to connect to MySQL from Java?

JDBC/ODBC has too much of a performance hit in our environments, and so
I'm looking for something better.

An alternative would be to spawn the MySQL client using something like

Process proc = Runtime.exec("mysql -B -n "+dbname);
proc.getInputStream().println("select * from "+table+";");
proc.getInputStream.close();
LineNumberReader result = new LineNumberReader(new
InputStreamReader(proc.getOutputStream());
result.readLine();
String line;
while ((line=result.readLine())!=null) {
String[] row = line.split("\t");
// now do something with row[0], row[1], etc.
}

However, for most reasonable workloads on production systems this would
probably involve much more overhead than just using the JDBC driver (process
creation versus a few function-calls). You also lose a lot of the
type-safety, error-checking and SQL injection protection that you could
easily get by using JDBC properly.




.



Relevant Pages

  • Re: non-JDBC/ODBC interface to MySQL 4.1?
    ... interface to connect to MySQL from Java? ... JDBC/ODBC has too much of a performance hit in our environments, ...
    (comp.lang.java.databases)
  • Re: MySQL JDBC driver - implications for non-GPLed apps
    ... tool that produces reports from the content of the existing database. ... > legitimate to interact with MySQL JDBC drivers via the JDBC interface. ... > GPL license on the driver. ... the application must identify the JDBC driver by its name. ...
    (comp.lang.java.databases)
  • JDBC Mysql Connect Problem
    ... I am trying to deploy a web-app using Tomcat which has simple Java ... beans using JDBC driver for mysql. ... saying "Could not establish connection to ...
    (comp.lang.java.programmer)
  • Re: Sun buys out MySQL
    ... Here we're assuming a getAttributethat returns a class name read from a deployment descriptor at run time. ... This idiom will work with any database system for which a JDBC driver JAR is available at run time, whether obtained from the application vendor or some other source (such as directly from MySQL). ... Every time I've encountered this controversy over whether the GPL restricts certain uses of GPLed JDBC drivers, it hinges on the definition of "linking" to the JDBC driver. ...
    (comp.lang.java.databases)
  • Re: JDBC Mysql Connect Problem
    ... > beans using JDBC driver for mysql. ... > sql tasks as usual. ... > saying "Could not establish connection to ...
    (comp.lang.java.programmer)