sql connection

by engin » Sat, 22 Aug 2009 22:43:57 GMT


Sponsored Links
 Hi I wrote java code that connects remote sql server. But code does
not work in android. Code is as follows:
try {

        DriverManager.registerDriver(new
com.microsoft.sqlserver.jdbc.SQLServerDriver());
        String url="jdbc:sqlserver://hostname";
        Connection conn=DriverManager.getConnection
(url,"username","password");
        Statement stmt=conn.createStatement();
        DatabaseMetaData meta = conn.getMetaData();
        if (conn != null) {
                txt.setText("Conection Succesful");

        }
    }
        catch(SQLException se)
        {
                System.out.println("ERROR: " + se.getMessage());
        }


And log is follows:

08-22 17:32:40.777: ERROR/AndroidRuntime(17582):
java.lang.VerifyError:
com.microsoft.sqlserver.jdbc.SQLServerConnection
08-22 17:32:40.777: ERROR/AndroidRuntime(17582):     at
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect
(SQLServerDriver.java:840)


--~--~---------~--~----~------------~-------~--~----~



sql connection

by Mark Murphy » Sat, 22 Aug 2009 22:51:34 GMT


 


Android does not include JDBC.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 In Print!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


sql connection

by akitto » Tue, 25 Aug 2009 01:05:31 GMT


 Not 100% sure as i am away form my computer and out on my android
phone, but I thought it would be more likely to be that you did not
include the Microsoft sql jar for your deployed environment.?




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to custom option menu to arrange four menu items at the one line??

standard four option menus displays 2 by 2 .
but i want to know that How to arrange 4 by 1.
I just want to custom option menu like that, any suggestion will be
grateful.
Thanks,

-- 

2. Dev guide

Does somebody have Android dev guide (http://developer.android.com/
guide/index.html) in PDF format?
I don't like to read on the computer, I'd like to print it but html
format is quite ugly.

-- 

3. android.webkit plugins

4. website login hashpassword?

5. The initial value of TextView's Text widget

6. Starting a Android Project in Eclipse

7. Keyboard.Key android:iconPreview attribute doesn't work