I am using Eclipse.My program is a stand alone
java swing front end using a MySQL database.I have set the encoding in MySQLI have queried the database with a statement from the MySQL server.This produces the correct output. But when I send it to the front end to display fron the database. It prints out "bheadh s," instead of "bheadh s�".
Here is the part of the code that retrieves an d prints it out.
public void verbSearch()
{
// connect to database books and query database
try
{
Class.forName( JDBC_DRIVER ); // load database driver class
// specify properties of JdbcRowSet
JdbcRowSet rowSet = new JdbcRowSetImpl();
rowSet.setUrl( DATABASE_URL ); // set database URL
rowSet.setCommand( "SELECT positive FROM verbTable4 " +
"WHERE
word = '" + verbList.getSelectedItem().toString()+ "'" ); // set query
rowSet.execute(); // execute query
// process query results
ResultSetMetaData metaData = rowSet.getMetaData();
int numberOfColumns = metaData.getColumnCount();
//System.out.println( "Authors Table of Books Database:" );
// display each row
while ( rowSet.next() )
{
for ( int i = 1; i <= numberOfColumns; i++ )
{
area.append( "\n"+ rowSet.getString( i ) + "\t");
}
System.out.println();
} // end while
} // end try
catch ( SQLException sqlException )
{
sqlException.printStackTrace();
System.exit( 1 );
} // end catch
catch ( ClassNotFoundException classNotFound )
{
classNotFound.printStackTrace();
System.exit( 1 );
} // end catch
} // end constructor