код: < /p>
Код: Выделить всё
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306//cart","student","student");
Statement st = con.createStatement();
ResultSet rs= st.executeQuery("select * from items");
rs.next();
String item =rs.getString("itemname");
System.out.println(item);

Location of the jar file:
Подробнее здесь: https://stackoverflow.com/questions/723 ... with-mysql