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.?

On Aug 22, 3:42 pm, engin <enginarsla...@gmail.com> wrote:
> 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)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to