andrerios 7 de dez. de 2007
maquiavelbona 7 de dez. de 2007
Se você colocar o derby.jar e o derbyClient.jar não funciona?
São esses dois que têm o JDBC driver.
Até!
thingol 7 de dez. de 2007
narinha 7 de dez. de 2007
Ah agora reconheceu ojdbc mas dá as seguintes mensagens:
Exception in thread “ main ” java . lang . ExceptionInInitializerError
at java . lang . Class . forName0 ( Native Method )
at java . lang . Class . forName ( Unknown Source )
at org . apache . derby . impl . drda . NetworkServerControlImpl . startNetworkServer ( Unknown Source )
at org . apache . derby . impl . drda . NetworkServerControlImpl . blockingStart ( Unknown Source )
at org . apache . derby . impl . drda . NetworkServerControlImpl . executeWork ( Unknown Source )
at org . apache . derby . drda . NetworkServerControl . main ( Unknown Source )
Caused by : java . lang . SecurityException : sealing violation : package org . apache . derby . iapi . services . locks is sealed
at java . net . URLClassLoader . defineClass ( Unknown Source )
at java . net . URLClassLoader . access $ 000 ( Unknown Source )
at java . net . URLClassLoader $ 1. run ( Unknown Source )
at java . security . AccessController . doPrivileged ( Native Method )
at java . net . URLClassLoader . findClass ( Unknown Source )
at java . lang . ClassLoader . loadClass ( Unknown Source )
at sun . misc . Launcher $ AppClassLoader . loadClass ( Unknown Source )
at java . lang . ClassLoader . loadClass ( Unknown Source )
at java . lang . ClassLoader . loadClassInternal ( Unknown Source )
at java . lang . Class . forName0 ( Native Method )
at java . lang . Class . forName ( Unknown Source )
at org . apache . derby . impl . services . monitor . BaseMonitor . getImplementations ( Unknown Source )
at org . apache . derby . impl . services . monitor . BaseMonitor . getDefaultImplementations ( Unknown Source )
at org . apache . derby . impl . services . monitor . BaseMonitor . runWithState ( Unknown Source )
at org . apache . derby . impl . services . monitor . FileMonitor . ( Unknown Source )
at org . apache . derby . iapi . services . monitor . Monitor . startMonitor ( Unknown Source )
at org . apache . derby . iapi . jdbc . JDBCBoot . boot ( Unknown Source )
at org . apache . derby . jdbc . EmbeddedDriver . boot ( Unknown Source )
at org . apache . derby . jdbc . EmbeddedDriver . ( Unknown Source )
… 6 more
O que será?
thingol 7 de dez. de 2007
Esse erro dá a impressão que o tal JAR foi repetido algumas vezes no seu classpath. Você pôs só uma versão do derby.jar e derbyClient.jar, ou eles estão copiados a torto e a direito pelo seu Java (por exemplo, eles foram copiados acidentalmente em jre\lib\ext?)
narinha 7 de dez. de 2007
É realmente estava já corrigido mas agra a mensagem é:
java.sql.SQLException: No suitable driver found for jdbc:derby:localhost:1527
narinha 7 de dez. de 2007
Oi eu mudei o endereço do meu programa para
package persistencia ;
import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.PreparedStatement ;
public class PersistenciaConexao {
public static Connection conexao ;
static {
try {
Class . forName ( "org.apache.derby.jdbc.ClientDriver" );
conexao = DriverManager . getConnection ( "jdbc:derby:" , "D:/TrabFinal/EletronicaProjeto/PjEletronica"
, "bancoeletronica" );
} catch ( Exception e ){
e . printStackTrace ();
};
}
public PersistenciaConexao (){
super ();
}
public PreparedStatement prepareStatement ( String string ) {
return null ;
}
public static void main ( String [] args ) {
new PersistenciaConexao ();
}
}
e agora a mensagem é:
java . sql . SQLException : Banco de dados ‘’ não encontrado .
at org . apache . derby . impl . jdbc . SQLExceptionFactory40 . getSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . Util . newEmbedSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . Util . newEmbedSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . Util . generateCsSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . EmbedConnection . newSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . EmbedConnection . ( Unknown Source )
at org . apache . derby . impl . jdbc . EmbedConnection30 . ( Unknown Source )
at org . apache . derby . impl . jdbc . EmbedConnection40 . ( Unknown Source )
at org . apache . derby . jdbc . Driver40 . getNewEmbedConnection ( Unknown Source )
at org . apache . derby . jdbc . InternalDriver . connect ( Unknown Source )
at org . apache . derby . jdbc . AutoloadedDriver . connect ( Unknown Source )
at java . sql . DriverManager . getConnection ( Unknown Source )
at java . sql . DriverManager . getConnection ( Unknown Source )
at persistencia . PersistenciaConexao . ( PersistenciaConexao . java : 14 )
at persistencia . PersistenciaCliente . gravar ( PersistenciaCliente . java : 27 )
at layout . CadastroCliente $ 1. actionPerformed ( CadastroCliente . java : 105 )
at javax . swing . AbstractButton . fireActionPerformed ( Unknown Source )
at javax . swing . AbstractButton $ Handler . actionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . fireActionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . setPressed ( Unknown Source )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( Unknown Source )
at java . awt . Component . processMouseEvent ( Unknown Source )
at javax . swing . JComponent . processMouseEvent ( Unknown Source )
at java . awt . Component . processEvent ( Unknown Source )
at java . awt . Container . processEvent ( Unknown Source )
at java . awt . Component . dispatchEventImpl ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . processMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . dispatchEvent ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Window . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . EventQueue . dispatchEvent ( Unknown Source )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForFilter ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . run ( Unknown Source )
Caused by : java . sql . SQLException : Banco de dados ‘’ não encontrado .
at org . apache . derby . impl . jdbc . SQLExceptionFactory . getSQLException ( Unknown Source )
at org . apache . derby . impl . jdbc . SQLExceptionFactory40 . wrapArgsForTransportAcrossDRDA ( Unknown Source )
… 41 more
java . lang . NullPointerException
at persistencia . PersistenciaCliente . gravar ( PersistenciaCliente . java : 28 )
at layout . CadastroCliente $ 1. actionPerformed ( CadastroCliente . java : 105 )
at javax . swing . AbstractButton . fireActionPerformed ( Unknown Source )
at javax . swing . AbstractButton $ Handler . actionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . fireActionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . setPressed ( Unknown Source )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( Unknown Source )
at java . awt . Component . processMouseEvent ( Unknown Source )
at javax . swing . JComponent . processMouseEvent ( Unknown Source )
at java . awt . Component . processEvent ( Unknown Source )
at java . awt . Container . processEvent ( Unknown Source )
at java . awt . Component . dispatchEventImpl ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . processMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . dispatchEvent ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Window . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . EventQueue . dispatchEvent ( Unknown Source )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForFilter ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . run ( Unknown Source )
então… eu não lembro o nome do banco que criei rsrsr então … tem outra maneira sem ser pelo eclipse para ver onde está o banco e qual o nome dele?
rafaelquines 7 de dez. de 2007
Amigo, uma dica pra vc.
Quando sabe a classe que quer, mas não sabe em que JAR essa classe encontra-se, dá uma olhada no site JarFinder que se existir, ele encontra. dá uma olhada: http://www.jarfinder.com/?class=org.apache.derby.jdbc.EmbeddedDriver&submit=search
flw