0

I want to implement a custom odbc driver which connects to a data source application written in java. What is the best language to implement a custom odbc driver for that?

Anupama Pathirage
  • 631
  • 2
  • 10
  • 22
  • So your goal is to let other applications to connect to yours using SQL syntax. Never mind difficulty to implement SQL protocol, why you just don’t provide web/rest API to your potential clients ? – Jurion Feb 16 '16 at 08:22
  • It already has web/rest api. I want to extend the capabilities by providing odbc interface so that it can be connected with set of other external tools as well. – Anupama Pathirage Feb 16 '16 at 08:24
  • Just to clarify, are you interested in having an application use the ODBC driver to talk to a Java-based data source? Or are you interested in having a Java application use the driver to talk to a data source written in a different language? – KylePorter Feb 16 '16 at 21:46

2 Answers2

1

If you're attempting to write an ODBC driver to a Java-backend, you can use the SimbaEngine SDK (http://www.simba.com/drivers/simba-engine-sdk/) which does most of the work for you. If you already have a REST interface, the language you write the driver in doesn't really matter if you want to use this interface (since you're going to the wire anyway). However, you have the option to use C++, Java, or C# to write your driver with the SDK above.

Sample code is shipped with the SDK, and it includes a SQLEngine so you don't have to worry about that unless you want to.

KylePorter
  • 469
  • 2
  • 6
-1
protected void startNetworkServer() throws Exception {  
    boolean restartCheck = this.restartFlag;  
    synchronized (serverStartSync) {  

        if (restartCheck == this.restartFlag) {  
            try {  

                if (cleanupOnStart) {  
                    synchronized (runQueue) {  
                            for (int i = 0; i < runQueue.size(); i++) {  
                                Session s = (Session) runQueue.get(i);  
                                s.close();  
                                removeFromSessionTable(s.getConnNum());  
                            }  
                            runQueue.clear();  
                        }  

                        cloudscapeDriver = null; // so it gets collected.  
                        System.gc();  
                    }  

                    /* load org.apache.derby.jdbc.EmbeddedDriver */  

                    Class.forName(CLOUDSCAPE_DRIVER).newInstance();  
                    cloudscapeDriver = DriverManager.getDriver(Attribute.PROTOCOL);  

                } catch (Exception e) {  
                    this.consoleExceptionPrintTrace(e);  
                    consolePropertyMessage("DRDA_LoadException.S", e.getMessage());  
                }  
                cleanupOnStart = true;  
                this.restartFlag = !this.restartFlag;  
            }  
        }  
    }
kesong
  • 1
  • 1