在我的 Java 应用程序中,下面的代码工作正常。但除了他们之外,我还想展示客户的照片。我不想将照片作为 blob 存储在数据库中。我只想将照片存储在某个本地驱动器中并在 jLabel 中显示。谁能帮我?
try{
Class.forName("org.apache.derby.jdbc.ClientDriver");
Connection conn= DriverManager.getConnection("jdbc:derby://localhost:1527/C:/gymsoft/data", "APP", "app");
Statement stmt=conn.createStatement();
String query ="SELECT * FROM CUSTOMER WHERE CODE = '"+jTextField1.getText()+"' ";
ResultSet rs = stmt.executeQuery(query);
if(rs.next()) {
String w = rs.getString("NAME");
String x = rs.getString("CODE");
TF1.setText(w);
TF2.setText(x);
} else {
JOptionPane.showMessageDialog(null, "User Not Found!!");
}
} catch ( ClassNotFoundException | SQLException e) {
JOptionPane.showMessageDialog(null, "Error In Connection!!");
}