How to compare gujarati string from mysql with text file.
Posted by: Dikshan Shah
Date: July 17, 2017 10:55PM

I am trying to read Gujarati string from MySQL database and compare with Gujarati text document.
Text document is stored with gujarati text.

can anyone solve this problem :

try
{
FileInputStream is1 = new FileInputStream("C:\\Program Files\\Apache Software Foundation\\Tomcat 7.0\\webapps\\ROOT\\WEB-INF\\classes\\147.txt");
BufferedReader br1 = new BufferedReader(new InputStreamReader(is1, "UTF-8"));

StringBuilder sb1 = new StringBuilder();
String L1;
while ((L1 = br1.readLine()) != null)
{
sb1.append(L1);
}
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(url,uname,password);
String sql= "SELECT dt_tag FROM tags";
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
{
date1 = rs.getString("dt_tag");
out.println("<br>Database value="+date1);
while(st1.hasMoreElements())
{
ss1=st1.nextElement().toString();
out.write("<br>"+ss1);
retval=ss1.contains(date1);
if(retval==true)
{
out.println("<br>Mathced");
flag++;
}
}
}

Options: ReplyQuote


Subject
Views
Written By
Posted
How to compare gujarati string from mysql with text file.
899
July 17, 2017 10:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.