我正在使用桌面应用程序,Java Swing并MySQL使用阿拉伯语将数据保存在数据库中UTF-8.
当我运行应用程序从Eclipse一切运作良好,但当我完成并将我的工作导出到runnable jar使用时Eclipse export,没有任何与数据库相关的工作.
Arabic我进入??????数据库但是,正如我之前提到的,当我运行它时,一切正常Eclipse.任何人都可以帮助我,我必须完成我的工作
这是我的工作样本:
这是我连接我的数据库的方式:
static Connection conn = null;
static String url = "jdbc:mysql://localhost:3306/";
static String dbName = "gestiondestock";
static String driver = "com.mysql.jdbc.Driver";
static String userName = "root";
static String password = "";
static String unicode= "?useUnicode=yes&characterEncoding=UTF-8";
Run Code Online (Sandbox Code Playgroud)
这是以下代码buttonLogin ActionPerformed:
private void buttonLogin_ActionPerformed(ActionEvent e) {
if(textField.getText().equals("") || passwordField.getText().equals(""))
{
jd =new JDialog();
jd.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jd.setTitle("?????? …Run Code Online (Sandbox Code Playgroud)