Nemmeno cambiando la stringa di connessione riesco ad avere risultati...
ecco il risultato dell'operazione:
20:15:16,028 INFO Environment:456 - Hibernate 3.0rc1
20:15:16,032 INFO Environment:469 - hibernate.properties not found
20:15:16,034 INFO Environment:502 - using CGLIB reflection optimizer
20:15:16,036 INFO Environment:532 - using JDK 1.4 java.sql.Timestamp handling
20:15:16,037 INFO Configuration:1228 - configuring from resource: /hibernate.cfg.xml
20:15:16,038 INFO Configuration:1199 - Configuration resource: /hibernate.cfg.xml
20:15:16,361 INFO Configuration:439 - Mapping resource: Honey.hbm.xml
20:15:16,480 INFO HbmBinder:256 - Mapping class: roseindia.tutorial.hibernate.Honey -> honey
20:15:16,515 INFO Configuration:1340 - Configured SessionFactory: null
20:15:16,516 INFO Configuration:844 - processing extends queue
20:15:16,516 INFO Configuration:848 - processing collection mappings
20:15:16,517 INFO Configuration:857 - processing association property references
20:15:16,517 INFO Configuration:884 - processing foreign key constraints
20:15:16,605 INFO Dialect:89 - Using dialect: org.hibernate.dialect.MySQLDialect
20:15:16,616 INFO SettingsFactory:87 - Maximum outer join fetch depth: 2
20:15:16,617 INFO SettingsFactory:90 - Default batch fetch size: 1
20:15:16,617 INFO SettingsFactory:94 - Generate SQL with comments: disabled
20:15:16,617 INFO SettingsFactory:98 - Order SQL updates by primary key: disabled
20:15:16,620 INFO SettingsFactory:273 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
20:15:16,627 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
20:15:16,628 INFO SettingsFactory:106 - Query language substitutions: {}
20:15:16,640 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
20:15:16,640 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 10
20:15:16,641 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
20:15:16,654 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3307/firsthibernate
20:15:16,655 INFO DriverManagerConnectionProvider:86 - connection properties: {user=root, password=****}
20:15:16,670 WARN SettingsFactory:142 - Could not obtain connection metadata
java.sql.SQLException: No suitable driver found for jdbc:jdbc:mysql://127.0.0.1:3307/firsthibernate
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionPr ovider.getConnection(DriverManagerConnectionProvid er.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(Se ttingsFactory.java:118)
at org.hibernate.cfg.Configuration.buildSettings(Conf iguration.java:1497)
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1041)
at roseindia.tutorial.hibernate.FirstExample.main(Fir stExample.java:23)
20:15:16,678 INFO SettingsFactory:148 - JDBC batch size: 15
20:15:16,678 INFO SettingsFactory:151 - JDBC batch updates for versioned data: disabled
20:15:16,680 INFO SettingsFactory:156 - Scrollable result sets: disabled
20:15:16,680 INFO SettingsFactory:164 - JDBC3 getGeneratedKeys(): disabled
20:15:16,684 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
20:15:16,686 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
20:15:16,687 INFO SettingsFactory:176 - Automatic flush during beforeCompletion(): disabled
20:15:16,687 INFO SettingsFactory:179 - Automatic session close at end of transaction: disabled
20:15:16,687 INFO SettingsFactory:260 - Cache provider: org.hibernate.cache.EhCacheProvider
20:15:16,692 INFO SettingsFactory:187 - Second-level cache: enabled
20:15:16,694 INFO SettingsFactory:192 - Optimize cache for minimal puts: disabled
20:15:16,695 INFO SettingsFactory:199 - Structured second-level cache entries: enabled
20:15:16,695 INFO SettingsFactory:203 - Query cache: disabled
20:15:16,695 INFO SettingsFactory:210 - Echoing all SQL to stdout
20:15:16,695 INFO SettingsFactory:214 - Statistics: disabled
20:15:16,696 INFO SettingsFactory:218 - Deleted entity synthetic identifier rollback: disabled
20:15:16,697 INFO SettingsFactory:232 - Default entity-mode: pojo
20:15:16,938 INFO SessionFactoryImpl:140 - building session factory
20:15:16,952 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Users/Prisco/Desktop/Hibernate/hibernate/net/roseindia/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
20:15:17,324 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
20:15:17,327 INFO Dialect:89 - Using dialect: org.hibernate.dialect.MySQLDialect
20:15:17,328 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
20:15:17,328 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 10
20:15:17,328 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
20:15:17,329 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL:jdbc:mysql://127.0.0.1:3307/firsthibernate
20:15:17,329 INFO DriverManagerConnectionProvider:86 - connection properties: {user=root, password=****}
20:15:17,329 INFO SchemaUpdate:105 - Running hbm2ddl schema update
20:15:17,330 INFO SchemaUpdate:117 - fetching database metadata
20:15:17,330 ERROR SchemaUpdate:129 - could not get database metadata
java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3307/firsthibernate
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionPr ovider.getConnection(DriverManagerConnectionProvid er.java:110)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:118)
at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:252)
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1043)
at roseindia.tutorial.hibernate.FirstExample.main(Fir stExample.java:23)
20:15:17,330 ERROR SchemaUpdate:158 - could not complete schema update
java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3307/firsthibernate
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionPr ovider.getConnection(DriverManagerConnectionProvid er.java:110)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:118)
at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:252)
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1043)
at roseindia.tutorial.hibernate.FirstExample.main(Fir stExample.java:23)
20:15:17,331 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:mysql://127.0.0.1:3307/firsthibernate
20:15:17,331 INFO SessionFactoryImpl:366 - Checking 0 named queries
null
Exception in thread "main" java.lang.NullPointerException
at roseindia.tutorial.hibernate.FirstExample.main(Fir stExample.java:55)
cmq ho provato entrambe le connessioni che mi hai detto tu...ma nada...da quello che vedo nn riesce a connettere...

Rispondi quotando