Register the drive and obtain the connection. register the drive to get it.
1. Three Methods for registering a drive
(1) Class. forName ("com. mysql. jdbc. Driver ");
(2) System. setProperty ("jdbc. drivers", "com. mysql. jdbc. Driver ");
(3) DriverManager. registerDrivers (new com. mysql. jdbc. Driver () is not recommended ());
3. Three methods to obtain the connection
(1) Connection conn = DriverManager. getConnection ("jdbc: mysql: // localhost: 3306/test", "root", "123456 ");
(2) Connection conn = DriverManager. getConnection ("jdbc: mysql: // localhost: 3306/test? User = root & password = 123456 ");
(3) Connection conn = DriverManager. getConnection (strUrl, props );
Database. properties configuration file
Jdbc. drivers = com. mysql. jdbc. Driver
Jdbc. url = jdbc: mysql: // localhost: 3306/test
Jdbc. user = root
Jdbc. password = 123456
...
Properties props = new Properties ();
FileInputStream in = new FileInputStream ("database. properties"); // obtain the database. properties configuration file
Props. load (in );
In. close ();
String strDriver = props. getProperty ("jdbc. drivers ");
String strUrl = props. getProperty ("jdbc. url ");
System. setProperty ("jdbc. drivers", strDriver );
Connection conn = DriverManager. getConnection (strUrl, props );
After connecting to the computer, you can see the disc drive letter in "My Computer" in the system, but double-click to open and read
D
How can a PLC be connected with a servo drive? Is there a wiring diagram?
It also depends on how you control the servo drive.
Use the servo driver manual to obtain the serial number and pin position of the control port. These include pulse, direction (pulse string control), analog input port (analog control), enable signal, encoder return, and alarm output.
After confirming the above port, pin and signal name, connect the above signal with the corresponding port pins of your PLC and positioning module or other modules, which is the wiring diagram you need.