well, I've tested the connection privilege before I post my question. I can use 'mysql' to connect to my database running on another machine.
The major problem is that OJB seems doesn't use the username and password which I set in build.properties to make the db connection. It's weired and I don't know why . Ken 於 四,2007-01-11 於 10:09 +0200,zkn 提到: > I suppose you have problem with privileges: > > Caused by: java.sql.SQLException: Access denied for user: > '[EMAIL PROTECTED]' (Using password: NO) > > Try to connect to the database using plain JDBC to see if your > connection parameters are OK. > > Ozkan > > Ken Hu wrote: > > Dear All: > > > > I am a newbie to Apache OJB. > > I dowload the binary package and some tutorials then I start to give it > > a try. > > Extract the contents from Tutorial2 and then put them to > > ojb-blank/src/java, the build is fine. > > > > The database information stored in build.properties are: > > > > jcdAlias=default > > databaseName=test > > databaseUser=ctu > > databasePassword=ta1hs1ung > > ............ > > ........... > > # For MySQL this would look like: > > dbmsName=MySQL > > jdbcLevel=3.0 > > jdbcRuntimeDriver=com.mysql.jdbc.Driver > > urlProtocol=jdbc > > urlSubprotocol=mysql > > urlDbalias=//192.168.2.202/${databaseName} > > > > When I execute the Application.class , I got : > > > > Welcome to the OJB ODMG tutorial application > > > > > > [0] List all product entries > > [1] Enter a new product > > [2] Edit a product entry > > [3] Delete a product entry > > [4] Quit Application > > type in number to select a use case > > > > Then I input 0 to list all stored prodcuts , but I got the folowing > > errors: > > > > ================================================================================================ > > Could not borrow connection from pool. Active/Idle instances in > > pool=0/0. org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: > > [EMAIL PROTECTED] > > jcd-alias=default > > default-connection=false > > dbms=MySQL > > jdbc-level=3.0 > > driver=com.mysql.jdbc.Driver > > protocol=jdbc > > sub-protocol=mysql > > db-alias=//192.168.2.202/test > > user=sa > > password=***** > > eager-release=false > > ConnectionPoolDescriptor={removeAbandonedTimeout=300, > > testWhileIdle=false, logAbandoned=false, testOnReturn=false, > > timeBetweenEvictionRunsMillis=-1, minIdle=0, numTestsPerEvictionRun=10, > > removeAbandoned=false, maxIdle=-1, fetchSize=0, whenExhaustedAction=0, > > minEvictableIdleTimeMillis=600000, testOnBorrow=true, maxActive=30, > > maxWait=10000} > > batchMode=false > > useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE > > ignoreAutoCommitExceptions=false > > > > [EMAIL PROTECTED] > > sequenceManagerClass=class > > org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl > > Properties={grabSize=20, autoNaming=true, seq.start=200000} > > . > > > > ] > > at > > org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.checkOutJdbcConnection(Unknown > > Source) > > at > > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnection(Unknown > > Source) > > at > > org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unknown > > Source) > > ... 16 more > > Caused by: org.apache.ojb.broker.accesslayer.LookupException: Error > > getting Connection from DriverManager with url > > (jdbc:mysql://192.168.2.202/test) and driver (com.mysql.jdbc.Driver) > > at > > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnectionFromDriverManager(Unknown > > Source) > > at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl > > $ConPoolFactory.makeObject(Unknown Source) > > at > > org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) > > ... 19 more > > Caused by: java.sql.SQLException: Access denied for user: > > '[EMAIL PROTECTED]' (Using password: NO) > > ================================================================================================ > > > > Well , I think I have speicified the correct username and password in > > build.properties, I don't know why it still use [EMAIL PROTECTED] as > > username to get a connection . > > Does anyone have the similar experience with me ? > > Please give me some help , thanks ! > > > > Ken > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- 研發部 胡重威 Ken Hu [EMAIL PROTECTED] 孟華科技股份有限公司 http://www.mmti.com.tw 地址: 高雄市802苓雅區中正一路120號4F-7 電話: 07-7279337 分機: 120 傳真: 07-7279377 行動: 0937083880 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]