- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在将从“listallButton”检索到的数据正确显示到 JTable 中时遇到问题。数据库正在将SELECT * FROM ATM
信息作为一组字符串正确发送。我不确定它是否被正确接收和记录,因为 JTables 没有显示任何数据并且出现空指针异常:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.*;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class AtmView extends JApplet implements ActionListener{
final static String banner = "WELCOME TO SHETH BANK!";
JLabel bannerLabel;
Border blackline;
CardLayout myLayout;
JPanel screensPanel; //main center panel
JPanel loginPanel; //login panel
JButton loginButton; //login button
JTextField accountNumber; //login account number field
JPasswordField password; //login password/PIN field
String access_lvl; //login access level
public String account;
String pass;
DataObject communicationObject;
final static String LOGIN = "LOGIN";
JPanel empPanel; //employee panel
CardLayout empLayout; //employee center panel
JButton createacctButton; //employee create account button
JButton listallButton; //employee list all accounts button
JPanel empcenterPanel;
final static String EMP1 = "EMPLOYEE";
String balance;
String withdrawal_amount;
String withdraw_amount;
JLabel balanceDisplay;
final static String LIST = "listallPanel";
JPanel listallPanel;
JTable table;
String[] data;
String[][] data2;
String[] temp;
String row;
DefaultTableModel tbm;
JLabel listdisplay;
String acclist;
ArrayList<String> al;
JButton empBackButton; //emp back
JButton emplogoutButton; //emp logout
JButton empwithdrawButton;
JPanel custPanel; //customer panel
final static String CUST = "CUSTOMER";
JButton checkbalButton; //check balance
JButton withdrawButton; //withdraw
JButton depositButton; //deposit
JButton transferButton; //transfer
JLabel display; //server response display area
@Override
public void init(){
getContentPane().setVisible(true);
getContentPane().setLayout(new BorderLayout());
getContentPane().setBackground(Color.BLUE);
//getContentPane().setBorder(blackline);
bannerLabel = new JLabel(banner,JLabel.CENTER);
bannerLabel.setVerticalTextPosition(JLabel.CENTER);
bannerLabel.setHorizontalTextPosition(JLabel.CENTER);
bannerLabel.setFont(new Font("Serif", Font.BOLD, 26));
bannerLabel.setForeground(Color.yellow);
blackline = BorderFactory.createLineBorder(Color.black);
//bannerLabel.setBorder(blackline);
add(bannerLabel, BorderLayout.NORTH);
//bannerLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, Color.BLACK));
myLayout = new CardLayout();
screensPanel = new JPanel();
screensPanel.setLayout(myLayout);
add(screensPanel, BorderLayout.CENTER);
//================ LOGIN VIEW ==================================
loginPanel = new JPanel(new GridLayout(3,1));
loginPanel.setBackground(Color.BLUE);
JLabel loginTitle = new JLabel("ENTER LOGIN INFO", JLabel.CENTER);
//loginTitle.setVerticalAlignment(SwingConstants.TOP);
loginTitle.setFont(new Font("Serif", Font.BOLD, 20));
loginTitle.setForeground(Color.yellow);
loginPanel.add(loginTitle);
JPanel accountInfo = new JPanel(new GridLayout(2,1));
accountInfo.setBackground(Color.blue);
JPanel accNum = new JPanel();
accNum.setBackground(Color.BLUE);
JLabel accLabel = new JLabel("Account Number: ", JLabel.CENTER);
accLabel.setFont(new Font("Serif", Font.BOLD, 14));
accLabel.setForeground(Color.yellow);
accountNumber = new JTextField(4);
accountNumber.setHorizontalAlignment(JTextField.CENTER);
accNum.add(accLabel);
accLabel.setLabelFor(accountNumber);
accNum.add(accountNumber);
accountInfo.add(accNum);
JPanel pw = new JPanel();
pw.setBackground(Color.BLUE);
JLabel pwLabel = new JLabel("Password/PIN: ", JLabel.CENTER);
pwLabel.setFont(new Font("Serif", Font.BOLD, 14));
pwLabel.setForeground(Color.yellow);
password = new JPasswordField(4);
password.setHorizontalAlignment(JTextField.CENTER);
pw.add(pwLabel);
pwLabel.setLabelFor(password);
pw.add(password);
accountInfo.add(pw);
loginPanel.add(accountInfo);
JPanel logBut = new JPanel();
loginButton = new JButton("Login");
loginButton.addActionListener(this);
logBut.setBackground(Color.blue);
logBut.add(loginButton);
loginPanel.add(logBut);
screensPanel.add(loginPanel, "LOGIN");
//================ EMPLOYEE VIEW ==================================
empPanel = new JPanel(new BorderLayout());
empPanel.setBackground(Color.BLUE);
JLabel empLabel = new JLabel("Employee View",JLabel.CENTER);
empLabel.setVerticalTextPosition(JLabel.CENTER);
empLabel.setHorizontalTextPosition(JLabel.CENTER);
empLabel.setFont(new Font("Serif", Font.BOLD, 20));
empLabel.setForeground(Color.yellow);
empPanel.add(empLabel, BorderLayout.NORTH);
empLayout = new CardLayout();
empcenterPanel = new JPanel();
empcenterPanel.setBackground(Color.blue);
empcenterPanel.setLayout(empLayout);
empPanel.add(empcenterPanel, BorderLayout.CENTER);
JPanel empbuttonPanel = new JPanel(new GridLayout(3,2));
empbuttonPanel.setBackground(Color.blue);
checkbalButton = new JButton("Check Balance");
checkbalButton.addActionListener(this);
empbuttonPanel.add(checkbalButton);
withdrawButton = new JButton("Withdraw");
withdrawButton.addActionListener(this);
empbuttonPanel.add(withdrawButton);
depositButton = new JButton("Deposit");
depositButton.addActionListener(this);
empbuttonPanel.add(depositButton);
transferButton = new JButton("Transfer");
transferButton.addActionListener(this);
empbuttonPanel.add(transferButton);
createacctButton = new JButton("Create account");
createacctButton.addActionListener(this);
empbuttonPanel.add(createacctButton);
listallButton = new JButton("List all accounts");
listallButton.addActionListener(this);
empbuttonPanel.add(listallButton);
empcenterPanel.add(empbuttonPanel, "EmpButtonPanel");
createPanel = new JPanel(new GridLayout(6,1));
createPanel.setBackground(Color.blue);
JLabel createTitle = new JLabel("Enter new account info: ",JLabel.CENTER);
createTitle.setVerticalTextPosition(JLabel.CENTER);
createTitle.setHorizontalTextPosition(JLabel.CENTER);
createTitle.setFont(new Font("Serif", Font.BOLD, 18));
createTitle.setForeground(Color.yellow);
createPanel.add(createTitle);
JPanel cloginPanel = new JPanel(new FlowLayout());
cloginPanel.setBackground(Color.blue);
JLabel cloginLabel = new JLabel("Account number: ",JLabel.CENTER);
cloginLabel.setVerticalTextPosition(JLabel.CENTER);
cloginLabel.setHorizontalTextPosition(JLabel.CENTER);
cloginLabel.setFont(new Font("Serif", Font.BOLD, 14));
cloginLabel.setForeground(Color.yellow);
cloginPanel.add(cloginLabel);
createloginField = new JTextField(4);
createloginField.setHorizontalAlignment(JTextField.CENTER);
cloginLabel.setLabelFor(createloginField);
cloginPanel.add(createloginField);
createPanel.add(cloginPanel);
JPanel cpinPanel = new JPanel(new FlowLayout());
cpinPanel.setBackground(Color.blue);
JLabel cpinLabel = new JLabel("PIN: ",JLabel.CENTER);
cpinLabel.setVerticalTextPosition(JLabel.CENTER);
cpinLabel.setHorizontalTextPosition(JLabel.CENTER);
cpinLabel.setFont(new Font("Serif", Font.BOLD, 14));
cpinLabel.setForeground(Color.yellow);
cpinPanel.add(cpinLabel);
createpinField = new JTextField(4);
createpinField.setHorizontalAlignment(JTextField.CENTER);
cloginLabel.setLabelFor(createpinField);
cpinPanel.add(createpinField);
createPanel.add(cpinPanel);
JPanel cbalPanel = new JPanel(new FlowLayout());
cbalPanel.setBackground(Color.blue);
JLabel cbalLabel = new JLabel("Starting balance: ",JLabel.CENTER);
cbalLabel.setVerticalTextPosition(JLabel.CENTER);
cbalLabel.setHorizontalTextPosition(JLabel.CENTER);
cbalLabel.setFont(new Font("Serif", Font.BOLD, 14));
cbalLabel.setForeground(Color.yellow);
cbalPanel.add(cbalLabel);
createbalanceField = new JTextField(10);
createbalanceField.setHorizontalAlignment(JTextField.CENTER);
cbalLabel.setLabelFor(createbalanceField);
cbalPanel.add(createbalanceField);
createPanel.add(cbalPanel);
JPanel clvlPanel = new JPanel(new FlowLayout());
clvlPanel.setBackground(Color.blue);
JLabel clvlLabel = new JLabel("Access level (1 for Employee, 2 for Customer): ",JLabel.CENTER);
clvlLabel.setVerticalTextPosition(JLabel.CENTER);
clvlLabel.setHorizontalTextPosition(JLabel.CENTER);
clvlLabel.setFont(new Font("Serif", Font.BOLD, 14));
clvlLabel.setForeground(Color.yellow);
clvlPanel.add(clvlLabel);
createlvlField = new JTextField(1);
createlvlField.setHorizontalAlignment(JTextField.CENTER);
cbalLabel.setLabelFor(createlvlField);
clvlPanel.add(createlvlField);
createPanel.add(clvlPanel);
JPanel createbutPanel = new JPanel();
createbutPanel.setBackground(Color.blue);
createButton = new JButton("Create");
createButton.addActionListener(this);
createbutPanel.add(createButton);
createPanel.add(createbutPanel);
empcenterPanel.add(createPanel, "createPanel");
listallPanel = new JPanel(new BorderLayout());
listallPanel.setBackground(Color.blue);
JLabel listTitle = new JLabel("All accounts in system: ",JLabel.CENTER);
listTitle.setVerticalTextPosition(JLabel.CENTER);
listTitle.setHorizontalTextPosition(JLabel.CENTER);
listTitle.setFont(new Font("Serif", Font.BOLD, 16));
listTitle.setForeground(Color.yellow);
listallPanel.add(listTitle,BorderLayout.NORTH);
String[] columnNames = {"Account Number","PIN","Access Level","Balance",};
String [][] rowTest = {{"1111","1111","1","1000",},{"1111","1111","1","1000",}};
String delimiter = ",";
tbm = new DefaultTableModel();
tbm.addColumn("Account Number");
tbm.addColumn("PIN");
tbm.addColumn("Access Level");
tbm.addColumn("Balance");
table = new JTable(tbm);
JScrollPane scrollPane = new JScrollPane(table);
listallPanel.add(scrollPane,BorderLayout.CENTER);
empcenterPanel.add(listallPanel, "listallPanel");
JPanel logoutPanel = new JPanel(new FlowLayout());
emplogoutButton = new JButton("Logout");
emplogoutButton.addActionListener(this);
empBackButton = new JButton("Back");
empBackButton.addActionListener(this);
logoutPanel.setBackground(Color.blue);
logoutPanel.add(emplogoutButton);
logoutPanel.add(empBackButton);
empPanel.add(logoutPanel, BorderLayout.SOUTH);
screensPanel.add(empPanel, "EMPLOYEE");
//================ CUSTOMER VIEW ==================================
}
public void actionPerformed(ActionEvent event) {
if (event.getSource() == loginButton) {
account = accountNumber.getText();
pass = password.getText();
String query = "SELECT access_level FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
access_lvl = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
if ((access_lvl.charAt(0)) == '1') {
myLayout.show(screensPanel, EMP1);
empLayout.first(empcenterPanel);}
else {myLayout.show(screensPanel, CUST); } }
else if(event.getSource() == emplogoutButton) {
accountNumber.setText("");
password.setText("");
account = "";
pass = "";
empLayout.first(empcenterPanel);
myLayout.show(screensPanel, LOGIN);
doLayout();}
else if(event.getSource() == checkbalButton) {
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
balanceDisplay.setText(balance);
//balanceDisplayPanel.add(balanceDisplay);
//checkBalancePanel.add(balanceDisplayPanel);
empLayout.show(empcenterPanel, EMPBAL); }
else if(event.getSource() == empBackButton) {
empLayout.first(empcenterPanel); }
else if(event.getSource() == withdrawButton) {
empLayout.show(empcenterPanel, EMPWITH); }
else if(event.getSource() == empwithdrawButton) {
withdraw_amount = withdrawField.getText();
Integer w_amt = Integer.valueOf(withdraw_amount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer oldbalance = Integer.valueOf(balance);
Integer newbalanceamount = oldbalance - w_amt;
balance2 = "" + newbalanceamount;
String query2 = "UPDATE ATM SET balance='"+balance2+"' WHERE account_number='"+account+"' AND pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e); }
withdrawField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == depositButton) {
empLayout.show(empcenterPanel, EMPDEP); }
else if(event.getSource() == empdepositButton) {
deposit_amount = depositField.getText();
Integer d_amt = Integer.valueOf(deposit_amount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer oldbalance2 = Integer.valueOf(balance);
Integer newbalanceamount2 = oldbalance2 + d_amt;
balance3 = "" + newbalanceamount2;
String query2 = "UPDATE ATM SET balance='"+balance3+"' WHERE account_number='"+account+"' AND pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
depositField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == transferButton) {
empLayout.show(empcenterPanel, EMPTNS); }
else if(event.getSource() == transferamountButton) {
fromAccount = fromField.getText();
toAccount = toField.getText();
transAmount = transferAmount.getText();
Integer t_amt = Integer.valueOf(transAmount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+fromAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer fromBalance = Integer.valueOf(balance);
String query2 = "SELECT balance FROM ATM a WHERE a.account_number='"+toAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer toBalance = Integer.valueOf(balance);
Integer newFromBalance = fromBalance - t_amt;
Integer newToBalance = toBalance + t_amt;
String newFBalance = "" + newFromBalance;
String newTBalance = "" + newToBalance;
String query3 = "UPDATE ATM SET balance='"+newFBalance+"' WHERE account_number='"+fromAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query3);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
String query4 = "UPDATE ATM SET balance='"+newTBalance+"' WHERE account_number='"+toAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query4);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
toField.setText("");
fromField.setText("");
transferAmount.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == createacctButton) {
empLayout.show(empcenterPanel, CREATE); }
else if(event.getSource() == createButton) {
createLogin = createloginField.getText();
createPin = createpinField.getText();
createLvl = createlvlField.getText();
createBalance = createbalanceField.getText();
String query = "INSERT INTO ATM VALUES ("+createLogin+","+createPin+","+createLvl+","+createBalance+")";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
createloginField.setText("");
createpinField.setText("");
createlvlField.setText("");
createbalanceField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == listallButton) {
String query = "SELECT * FROM ATM";
String delimiter = ",";
String input = "go";
int count=0;
al = new ArrayList<String>();
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
input = communicationObject.getMessage();
if (input != "stop") {
al.add(input);
data[count] = input;
count++; }
for (int i=0;i<data.length;i++) {
row = data[i];
temp = row.split(delimiter);
tbm.addRow(new String[] {temp[0],temp[1],temp[2],temp[3]}); }
table.setModel(tbm);
table.repaint();
//Object Object_Array[]=al.toArray();
//data=new String[Object_Array.length];
//for (int i=0;i<data.length;i++) {data[i]=Object_Array[i].toString();}
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
empLayout.show(empcenterPanel, LIST); }
} }
堆栈跟踪:
java.lang.NullPointerException at AtmView.actionPerformed(AtmView.java:757) at
javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at
javax.swing.DefaultButtonModel.setPressed(Unknown Source) at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at
java.awt.Component.processMouseEvent(Unknown Source) at
javax.swing.JComponent.processMouseEvent(Unknown Source) at
//...
java.awt.EventQueue.dispatchEventImpl(Unknown Source) at
java.awt.EventQueue.access$000(Unknown Source) at
java.awt.EventQueue$3.run(Unknown Source) at
java.awt.EventQueue$3.run(Unknown Source) at
最佳答案
空点异常可能是由数据库中的某些空列引起的。你的做法不好,如果数据库中有大量记录的话会让你的程序崩溃,更好的方法是使用分页来避免加载大量记录。
关于从 Oracle DB 加载 Java JTable 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10398221/
我当前正在存储给定产品的上传图像,如下所示: class Product(db.Model): images= db.ListProperty(db.Blob) # More prop
每次对架构或新迁移文件进行更改时,我都会运行以下命令: rake db:drop db:create db:migrate db:seed 是否有预先构建的等效方法来执行此操作? 我从我读到的内容中想
在 android 中使用房间作为数据库。当我试图在 sqlviewer 中查看数据时,在数据库文件中找不到表Myapp.db 文件为空。数据/data/packageName/databases/M
我搜索并尝试了很多次,但没有找到我的答案。我有一些用小 cucumber (在 Rails 项目中)编写的项目的功能文件。所有步骤都已定义,如果我单独启动它们,功能本身运行得很好。我可以将所有场景与我
您必须承认,对于 Rails 和数据库的新手来说,rubyonrails.org 上的官方解释使所有这四个任务听起来完全一样。引用: rake db:test:clone Recreate the
当我尝试运行时: heroku run rake db:drop db:create db:migrate 我得到错误: Running rake db:drop attached to termin
rake db:migrate 和 rake db:reset 之间的区别对我来说非常清楚。我不明白的是 rake db:schema:load 与前两者有何不同。 只是为了确保我在同一页面上: ra
我们都知道,我们可以使用 Azure 函数(使用 out 参数或使用 return)在 cosmos DB 中一次保存一个文档,例如: object outputDocument = new { i
我有一个包含 60 多个表的 mysql 数据库。这是在我将 joomla 版本 2.5.3 从本地灯移植到网络服务器时构建的。 我运行 mysql-db: 移植后我发现我无法登录 amdin 区域。
我想轻松地将现有数据库迁移到 Azure 托管。在我的项目中,我使用 Entity Framework DB First。有什么经验教训或例子可以说明如何做到这一点吗? 最佳答案 您本地使用什么数据库
所以,我一直在使用 MagicalRecord 开发 iPad 应用程序,最近在转移到自动迁移商店后我遇到了一些问题。我需要将我的 .db 文件从一个设备同步到另一个设备,所以我需要所有数据都在 .d
自从我在 Heroku 上部署并希望与生产相匹配后,我最近切换到 postgres 来开发一个 Rails 应用程序。当我将数据库名称设置为“postgres”时,我的应用程序安装了 Postgres
我使用 oledb 提供程序(SQLOLEDB 和 SQL Native OLEDB 提供程序)创建了一个示例应用程序。 案例 1:提供者 = SQLOLEDB hr = ::CoInitialize
我正在为 NodeJs 使用 mongodb 驱动程序,其中有 3 个方法: 1) db.collection.insert 2) 数据库.collection.insertOne 3) db.col
我是 datomic 的新手,我仍在努力弄清楚系统是如何构建的。特别是,我不明白 :db.part/db 扮演什么角色,因为每次安装架构时似乎都需要它。有人可以解释一下这一切意味着什么吗? (需要 '
Berkeley DB 是否有空间索引,例如 R-tree? 最佳答案 有人问the same question on the Oracle forum .还没有甲骨文回答。但答案是否定的,它没有任何
请解释一下这是什么意思 $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); 它给了我一个错误 "E
berkeley-db-je 的最新版本是什么? 来自 oracle , 为 7.5。 但来自maven存储库,它是 18.3.12。 有没有人知道更多的细节? 最佳答案 Berkeley DB Ja
我不明白查询构建器的替换和更新之间的区别。尤其是替换文档... This method executes a REPLACE statement, which is basically the SQL
看起来 BerkeleyDB 被 Oracle 收购了,它没有在其网站上发布源代码? 最佳答案 Sleepycat 于 2006 年被 Oracle 收购。该产品继续在原始开源许可下可用,并继续得到增
我是一名优秀的程序员,十分优秀!