Salve,
sono nuovo nell'ambito dei database sto cercando di crearne purtoppo non riesco a trovare una guida completa in italiano per quanto riguarda Mysql workbench.... vorrei qualche informazione riguardante le view.
Salve,
sono nuovo nell'ambito dei database sto cercando di crearne purtoppo non riesco a trovare una guida completa in italiano per quanto riguarda Mysql workbench.... vorrei qualche informazione riguardante le view.
Ciao,
cosa vorresti sapere?
Non si può risolvere un problema usando lo stesso modo di pensare che ha creato quel problema.
Albert Einstein
Siate Affamati, siate Folli, siate Onesti e siate Generosi
mi servirebbe sapere la sintassi da usare per collegare le view alle tabelle e poi come faccio a collegare il database al programma che sto realizzando con java...
Spero di essere stato chiaro...
credo tu abbia le idee un po confuse.
1) La creazione delle viste è indipendente dall'utilizzo del workbench. Le viste si creano usando la sintassi standard prevista da mysql.
2) Anche collegare il DB all'applicazione java è un qualcosa estraneo al workbench infatti dovrai scaricarti dal sito di mysql il connettore java e richiamarlo da codice java
![]()
Non si può risolvere un problema usando lo stesso modo di pensare che ha creato quel problema.
Albert Einstein
Siate Affamati, siate Folli, siate Onesti e siate Generosi
grazie di tutto ora c'è un nuovo problemino quando avvio l'applicazione in eclipse mi esce questo errore :
com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:41 1)
at com.mysql.jdbc.SQLError.createCommunicationsExcept ion(SQLError.java:1121)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:357)
at com.mysql.jdbc.ConnectionImpl.coreConnect(Connecti onImpl.java:2482)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(Co nnectionImpl.java:2519)
at com.mysql.jdbc.ConnectionImpl.createNewIO(Connecti onImpl.java:2304)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImp l.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connect ion.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:41 1)
at com.mysql.jdbc.ConnectionImpl.getInstance(Connecti onImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ProvaConnessione.main(ProvaConnessione.java:12)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Un known Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress( Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:259)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:307)
... 15 more
Che devo fare? grazie
Ti incollo di seguito una breve guida (in inglese) per risolvere il tuo problema:
If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn't reachable at all. This can have one or more of the following causes:
- IP address or hostname in JDBC URL is wrong.
- Hostname in JDBC URL is not recognized by local DNS server.
- Port number is missing or wrong in JDBC URL.
- DB server is down.
- DB server doesn't accept TCP/IP connections.
- DB server has run out of connections.
- Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
To solve the one or the other, follow the following advices:
- Verify and test them with ping.
- Refresh DNS or use IP address in JDBC URL instead.
- Verify it based on my.cnf of MySQL DB.
- Start the DB.
- Verify if mysqld is started without the --skip-networking option.
- Restart the DB and fix your code accordingly that it closes connections in finally.
- Disable firewall and/or configure firewall/proxy to allow/forward the port.
Non si può risolvere un problema usando lo stesso modo di pensare che ha creato quel problema.
Albert Einstein
Siate Affamati, siate Folli, siate Onesti e siate Generosi