我已经将印地语数据存储在MySQL数据库中。见下图-

现在,我想获取这些数据并显示在我的JSP页面上,但是当我尝试以Java代码获取数据时,我正在将文本添加到以下格式中
UID= ????/??????????/????/?????/?????/Test upgrade/1
UID= ????/??????????/??????/??????/??????????/159/1
UID= ????/??????????/??????/??????/??????????/190/1
UID= ????/??????????/??????/??????/??????????/194/1
UID= ????/??????????/??????/???????/?????? (??.)/730/1
UID= ????/??????????/??????/???????/?????? (??.)/742/1/1
UID= ????/??????????/??????/???????/?????? (??.)/732/1
UID= ????/??????????/??????/??????/??????/98/8/1
UID= ????/??????????/??????/??????/??????/48/10/1
Run Code Online (Sandbox Code Playgroud)
关于此问题,我已将数据库字符集更改为“ utf8_unicode_ci”,但仍无法正常工作。我已经编写了以下代码来获取数据
// Method to fetch data from database.
public void getDetails()
{
// Establish connection to the database
DBConnection bdConnection = new DBConnection();
java.sql.Connection connectionObject = null;
java.sql.ResultSet resultSetObject;
java.sql.PreparedStatement preparedStatementObj = null;
// Get DB connection.
connectionObject = bdConnection.getDbConnection();
// Check if connection not null..?
if (connectionObject != null)
{
// Query …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Android应用程序,因为我想要对用户进行身份验证之后要求USER_ID和PASSWORD,因为我已经编写了一个PHP脚本[我正在使用MySQL数据库(WAMP服务器)]但是不要不知道为什么,我收到以下错误 -
mysql_num_rows()期望参数1是资源,第35行的C:\ wamp\www\android_connect\authenticate_user.php中给出的对象
我想在这里提到的另一件事是:我正在传递/输入正确的USERNAME&PASSWORD(存在于数据库中),但它仍然给我以下消息
不是有效用户(未找到)
为了更好地理解,请参阅authenticate_user.php下面给出的代码和LogCat文本.
authenticate_user.php:
<?php
/*
* Following code will authenticate the user
* User_ID & Password are read from HTTP Post Request
*/
// array for JSON response
$response = array();
// check for required fields
if (isset($_POST['user_id']) && isset($_POST['password']))
{
$user_id = $_POST['user_id'];
$password= $_POST['password'];
echo "Inside PHP Script" . PHP_EOL;
echo $user_id . PHP_EOL;
echo $password . PHP_EOL;
// include db connect class
require_once __DIR__ . …Run Code Online (Sandbox Code Playgroud)