📄 16g.txt
字号:
public AccountPK ejbFindByPrimaryKey(AccountPK key) throws RemoteException, ObjectNotFoundException
{
Connection connection = null;
PreparedStatement statement = null;
try
{
connection = getConnection();
statement = connection.prepareStatement
("SELECT name FROM Savings_Accounts WHERE name = ?");
statement.setString(1, key.name);
ResultSet resultSet = statement.executeQuery();
if(!resultSet.next())
{
throw new ObjectNotFoundException("Could not find: " + key);
}
return key;
}
catch(SQLException e)
{
throw new RemoteException("Could not find: " + key, e);
}
finally
{
try
{
if (statement != null)
{
statement.close();
}
if (connection != null)
{
connection.close();
}
}
catch (SQLException sqe)
{
throw new RemoteException("Could not find: " + key, sqe);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -