package br.com.unip.pedidosPizzaria.dao;
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
public class Testeb {
public static void main(String[] args) throws SQLException {
Connection conection = DriverManager
.getConnection("jdbc:sqlserver://localhost:1433;/databaseName=PIZZARIA", "kayque", "Cintra@1998");
Statement st = conection.createStatement();
st.execute("SELECT NOME, ENDERECO FROM TB_CLIENTE");
ResultSet rst = st.getResultSet();
if(rst.next()) {
String nome = rst.getString("NOME");
System.out.println(nome);
String endereco = rst.getString("ENDERECO");
System.out.println(endereco);
}