Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bazededate;
- import java.sql.*;
- public class Main {
- public static void main(String[] args) throws Exception {
- // import the db's driver - de luat de pe net + inclus in classpath / IDE
- Class.forName("com.mysql.jdbc.Driver");
- // connect to the db
- Connection c =
- DriverManager.getConnection("jdbc:mysql://192.168.0.79/laborator","laborator","laborator");
- //TODO go play with your dick in the sand
- Statement stmt = c.createStatement();
- ResultSet result = stmt.executeQuery("SELECT * FROM Persoane_1");
- while (result.next())
- System.out.println(
- result.getString("Prenume") + "\t" +
- result.getString("Nume") + "\t" +
- result.getInt("Salariu")
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement