Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void returInfoClient(userClient) {
- Connection mConn = (new ConnectionFactory()).getConnection();
- String sql = "SELECT nameClient, userClient, descriptionClient, passwordClient, birtDate
- FROM Client
- WHERE userClient LIKE 'userClient%';" //quero que o userClient venha do parametro da função
- + "values(?);";
- try {
- PreparedStatement stmt = mConn.prepareStatement(sql);
- stmt.setString(1, userClient); //quero usar o userClient do parametro da função para o like do select
- stmt.execute();
- stmt.close();
- System.out.println("retornando informações author");
- connection.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- String sql = "SELECT nameClient, userClient, descriptionClient, passwordClient, birtDate FROM Client WHERE userClient LIKE '?%';"
- public void returInfoClient(TipoDoObjeto userClient) {
- public void returInfoClient(userClient) {
- Connection mConn = (new ConnectionFactory()).getConnection();
- String sql = "SELECT nameClient, userClient, descriptionClient, passwordClient, birtDate FROM Client WHERE userClient LIKE ?";
- try {
- PreparedStatement stmt = mConn.prepareStatement(sql);
- stmt.setString(1, userClient + "%");
- stmt.execute();
- stmt.close();
- System.out.println("retornando informações author");
- connection.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment