Import java.sql. *;
class callstore {public static void main (String [] args) {try {String driverStr = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; Class.forName (driverStr) .newInstance (); Connection conn = DriverManager.getConnection ( " JDBC: Microsoft: SQLServer: //61.28.18.53: 1433; DatabaseName = Soutecinfosale "," sa "," soutec "); callablestatement st = conn.prepareCall (" {call adduser (?,?)} "); //// PreparedStatement st = conn.prepareCall ( "update SMS_Admin set PersonName = where PersonID = 'honeymoon'?"); // PreparedStatement st = conn.prepareCall ( "{call test}"); // Statement st = conn.createStatement () St.setString (1, "sssssssss"); st.setstring (2, "honey"); // st.setstring (3, "honey"); // st.setstring (4, "000"); / / String SQL = "{CALL Adduser (?,?)}"; // resultset = st.executeQuery (SQL); INT i = st.executeUpdate (); //rs.next (); //system.out .println (rs.getstring (5)); //rs.next (); // system.out.println (rs.getstring (5));} catch (sqlexception se) {system.out.println (SE. Getmes sage ()); se.printStackTrace ();} catch (ClassNotFoundException cnf) {System.out.println (cnf.getMessage ()); cnf.printStackTrace ();} catch (InstantiationException ite) {System.out.println ( ITE.GetMessage (); item (} catch (lylegalaccessexception}) {system.out.println (Iae.getMessage (); IAE.PrintStackTrace ();}
}