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. Switching Tab Activities from Sub Activities.

I came to a solution to this problem. The idea is to send a
TabSwitcher Object with the Intent to the child classes which can then
use this to switch between tabs, this can be extended to finishing and/
or creating activities into the tab from the sub activities. Check out
the blog and the source code link is attached to the blog.

http://arca1n.blogspot.com/2010/08/tab-switching-using-menu-options-in.html

-- 

2. How to read pdf file into my customize android app

How to code for reading a pdf file in android? i want to build an app
like RepliGo reader. So, Please enlighten me to read pdf by using
android sdk or ndk.

-- 

3. Is it possible to determine a input method in application

4. Visit Installed App Details Page on Android 2.2

5. JIT compilation on Dalvik VM

6. Accelerometer not working when screen turns off

7. Application Background