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. ADC 2 and Android Market Place Application Error

Hi,

You don't have to refactor your Java code to a new namespace. Instead,
you can try changing the package attribute within the manifest and
make sure the classnames are fully qualified.

Cheers,
James











> 

2. GK : Ho to Skip DroidDo

Hi all,
    Am  compiling the Android Platform source code. It took around 4
hrs to compile the package.
I Used $ make -j4 sdk

Can any one suggess how to minimize the time and I dont want for
compile the javadoc everytime
How to skip this DroidDoc. ?
Help me out.

Thanks in Advance.

-- 

3. UI Testing in Android Frameworks

4. How to load a file from assets directory in native code?

5. Android 2.0 Review

6. access Java code from WebKit plugin

7. Figuring out android.telephony.cdma