Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class EvenMoreQuerys {
- public static void main(String[] args) {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- } catch (Exception f) {
- System.out.println("Can't load MySQL driver, exiting...");
- System.exit(-1);
- }
- final String dbURL = "jdbc:mysql://slo.swe.fh-luebeck.de:3306/Di2a";
- final String user ="Di2a";
- final String password = "CRFANe42c5mfxzD2";
- String x = "Mid";
- try {
- Connection con = DriverManager.getConnection(dbURL, user, password);
- CallableStatement cs = con.prepareCall("{call LaneNicks(?)}");
- ResultSet rs = cs.executeQuery();
- while(rs.next()) {
- String name = rs.getString("Name");
- System.out.print(name + ", ");
- }
- //System.out.println("Success");
- } catch (SQLException ex) {
- System.out.println("statement failed");
- System.out.println("SQLException: " + ex.getMessage());
- System.out.println("SQLState: " + ex.getSQLState());
- System.out.println("VendorError: " + ex.getErrorCode());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement