Re: [android-developers] exception while accessing MS SQL 2005 express using JDBC

2011-02-12 Thread Kostya Vasilyev
Looks like the driver wants to use an SSL socket in non-blocking mode, 
and Android networking code (taken from Apache Harmony) doesn't support it.


You could try setting "encrypt=false", or, if that's not acceptable, 
find another way to access the database (e.g. a web service).


-- Kostya

04.02.2011 7:55, Niket пишет:

"com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "Unable to make socket non blocking"."



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] exception while accessing MS SQL 2005 express using JDBC

2011-02-11 Thread Niket
Hi,
I downloaded JDBC driver from microsoft.com
(sqljdbc_3.0.1301.101_enu.exe), and use sqljdbc4.jar file in my code,
to connect with MS SQL 2005 Express.

I wrote very simple code. It provides exception while doing
getConnection().

String driver= "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //
Start JDBC
String dbURL = "jdbc:sqlserver://192.168.1.2\
\sqlexpress;databaseName=dbname;encrypt=true;trustServerCertificate=false";
String user="sa",pass="abc@123";
java.sql.Connection dbConn = null;
try
{
Class.forName(driver);
dbConn = DriverManager.getConnection(dbURL,user,pass);
dbConn.close();
}
catch (Exception e)
{
e.printStackTrace();
}
**
code is working properly when it is run from windows system.
On android system,
"class.forname(driver);" is working properly.
"getconnection()" function fails; it throws exception that
"com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "Unable to make socket non blocking"."

Can you please help into this?

Thanks
Niket

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