groovy - SOAPUI database connection error[local port 127.0.0.1:4321 cannot be bound] -


local port 127.0.0.1:4321 cannot bound, please see code below details, note using lport - 4321. need use different? if yes, how can find one?

package mypackage import groovy.sql.sql import java.sql.* import com.jcraft.jsch.jsch import com.jcraft.jsch.session   // ssh login string sshhost = 'abc.com' string sshuser = 'test' string sshpass = 'test' int sshport = 22 string boundaddress ="0.0.0.0"; // database login targethost = 'localhost' targetuser = 'test' targetpass = 'test' targetport = 3306 lport = 4321  jsch jsch = new jsch(); session session = jsch.getsession(sshuser, sshhost, sshport); session.setpassword(sshpass); session.setconfig("stricthostkeychecking", "no"); system.out.println("establishing connection..."); session.connect(); int assinged_port=session.setportforwardingl(lport, targethost, targetport);  connection con = null; string driver = "org.mariadb.jdbc.driver"; string connectionstring = "jdbc:mariadb://" + targethost +":" + lport + "/"; con = drivermanager.getconnection(connectionstring, targetuser, targetpass); statement st = con.createstatement(); string sql = "select * company " st.execute(sql); 


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -