如何连接SQL服务器和android studio

如何连接SQL服务器和android studio

问题描述:

hi friends ,am using android studio and sql server ,for building a dictionay ,how to insert the datas in sql server? and how to connect the sql server and android studio?if i searching the words means it will display the meaning of that words .so i want a search coding for this





我尝试了什么:



i尝试了如何在sql server中插入数据但是我知道如何在android studio和搜索中连接搜索的代码



What I have tried:

i tried how to insert the data in sql server but i dnt knw how to he connect in android studio and the search code for searching

Android Studio主要使用Java作为默认语言。为此,您必须使用JDBC驱动程序与SQL Server进行通信。 用于SQL Server的Microsoft JDBC驱动程序 [ ^ ]。它们可以让您连接到安装的SQL引擎,然后您可以在服务器上执行查询以获取或插入数据。



即使这样,一旦编译了应用程序,那将毫无用处。我建议你改用SQLite数据库。 Android对SQLite数据库有本机支持,这是Android中首选的数据存储方法。您可以了解如何在Android SQLite数据库中存储数据以及如何从提供的链接中获取数据。 在SQL数据库中保存数据Android开发者 [ ^ ]



如果您仍想使用SQL Server,我建议使用API​​连接到SQL Server数据库。你不打算在Android上安装SQL Server,不是吗? : - )
Android Studio primarily uses Java as the default language. To do that, you would have to use the JDBC drivers to communicate with SQL Server. Microsoft JDBC Driver for SQL Server[^]. They would let you connect to the SQL engine installed, and then you can execute the queries on the server to get or insert the data.

Even then, once the application is compiled, that would be of no use. I would recommend that you use SQLite databases instead. Android has a native support for SQLite databases and that is the preferred data storage method in Android. You can learn how to store the data in Android SQLite databases and how to get that from the provided link. Saving Data in SQL Databases | Android Developers[^]

If you still want to use SQL Server, I would recommend using an API to connect to the SQL Server database through. You are not going to install SQL Server on the Android itself, are you? :-)


尝试一些研究:连接sql server和android studio - Google搜索 [ ^ ]。
Try a little research: connect the sql server and android studio - Google Search[^].