Help Please: How to make a connection pool with mySQL

Hi,
I am learning the example codes shipped with weblogic server, which is under ...samples\examples\ejb20\basic\beanManaged. The original connection pool was on cloudscape. I was trying to modify it and make it connect to mySQL.
In ejb-jar.xml and weblogic-ejb-jar.xml, I replaced "demopool" (which was the original pool name) with "demopool1".
After starting the server, I tried to configure a new connection pool as following:
Name: demopool1
URL: jdbc:mysql:///test
Driver Classname: org.gjt.mm.mysql.Driver
Properties
(key=value): user=none
server=none
But I got the following errors:
<2007-10-5 ??06?30?09?> <Error> <JDBC> <Cannot startup connection pool "demopool1" Cannot load driver class: org.gjt.mm.mysql.Driver>
What should I do to let the server find the Driver?
Thanks a lot.

Hong Qu wrote:
Thank you Joe,
I added the jar file location to the startExampleServer script. But when I tried to configure the Tx Data Sources from the console, I got the following error:
<2007-10-5 ??08?35?17?> <Notice> <WebLogicServer> <Started WebLogic Admin Server "examplesServer" for domain "examples" running in Development Mode>
setEntityContext called
ejbFindByPrimaryKey (ID: 0)
Failed to lookup JDBC Datasource. Please double check that
the JNDI name defined in the resource-description of the
EJB's weblogic-ejb-jar.xml file is the same as the JNDI name
for the Datasource defined in your config.xml.
<2007-10-5 ??08?38?16?> <Error> <JDBC> <Error during Data Source creation:
weblogic.common.ResourceException: DataSource(examples-dataSource-demoPool1)
can't be created with non-existent Pool (connection or multi) (demoPool1)>>
Do you know where is wrong?
Another problem is the connection method in AccountBean.java:
private Connection getConnection()
throws SQLException
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/demoPool");First verify from the console that a pool 'demoPool1' exists and
that you can test it from the console. Then find the DataSource
you associated with that pool. For an EJB I would suggest a
TxDataSource. You defined some JNDI name for the DataSource. Use
that name in the lookup. For instance, if your DataSource's
JNDI name is 'MyDataSource', the code should do this:
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("MyDataSource");
return ds.getConnection();
} catch(NamingException ne) {
log("Failed to lookup JDBC Datasource. Please double check that");
log("the JNDI name defined in the resource-description of the ");
log("EJB's weblogic-ejb-jar.xml file is the same as the JNDI name ");
log("for the Datasource defined in your config.xml.");
throw new EJBException(ne);
} finally {
try {
if(initCtx != null) initCtx.close();
} catch(NamingException ne) {
log("Error closing context: " + ne);
throw new EJBException(ne);
I couldn't figure out what "java:comp/env/jdbc/demoPool" was related, so I just replaced "demopool" with "demopool1". Do you konw what "comp/env/jdbc" mean? Is it a location?
Thank you so much.
Iris

Similar Messages

  • How to make a connection pools to oracle 10g in sun application server 8

    env:
    windows xp.
    sun application server 8
    oracle 10g in windows xp .
    I do this
    1: copy the oracle jdbc ojdbc14.jar orai18n.jar file to sun/appserver/lib
    2. add path in admin console
    3. restart the server
    4. make a connnect pools with resource type javax.sql.DataSource
    5.add properties with password,username ,database name= jdbc:oracle:thin:@127.0.0.1:1521:orcl ,(with this url ,my jdbc program can connect oracle10).
    6 .try the ping , it show Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: &#25351;&#23450;&#20102;&#26080;&#25928;&#30340;(direct to unusale) Oracle URL: OracleDataSource.makeURL
    please replay to me ,thank very much.

    I change the thin driver to oci driver ,jdbc:oracle:oci:@orcl ,then fix the problem.

  • How to make a question pool with MANY questions?

    I would like to make a question pool
    with several thousand questions, which I currently have in an
    Excel file. Is there a way around having manually to enter all
    questions in a Captivate question pool?
    Thanks.

    I would use the XML function from Captivate 4.
    - Make yourself a test quiz with two slides, one being a multiple choice.
    - Export it to XML
    - Open the XML File in Excel
    Good point to start with is ns1:g and ns1:Source26.
    Most likely you can get all your question into captivate that way.
    Mr_TD

  • Connection Pool with MySQL

    Can anyone tell me all necessary steps required to create a connection pool to
    MySQL and use the datasource to get the connection in BMP beans
    Thanks in advance
    Thara

    Using weblogic's mssql driver:
    define following configuration in your config.xml.
    <JDBCConnectionPool
    Name="MSSQLPool"
    Targets="myserver"
    URL="jdbc:weblogic:mssqlserver4"
    DriverName="weblogic.jdbc.mssqlserver4.Driver"
    InitialCapacity="0"
    MaxCapacity="20"
    CapacityIncrement="1"
    Properties="user=jmsqa;password=jmsqa123;server=lcdbnt4"
    />
    <JDBCDataSource
    Name="jdbc.pool.testpool"
    Targets="myserver"
    JNDIName="jdbc.pool.testpool"
    PoolName="testpool"
    />
    Also, do following to make sure your environment is set.
    java utils.dbping MSSQLSERVER4 USER PASS DBNAME@HOST:PORT
    Thara wrote:
    Can anyone tell me all necessary steps required to create a connection pool to
    MySQL and use the datasource to get the connection in BMP beans
    Thanks in advance
    Thara

  • Connection pooling with mysql!!

    Hi,
    I've been reading about connection pooling for days. I want to use it with mysql. I believe that the vendor usually supplies implementations for the javax.sql.PooledConnection and javax.sql.ConnectionPoolDataSource, but I can't find this on the mysql site or any forums.
    PoolMan from www.codestudio.com was suggested but that doesn't seem to exist anymore.
    I really don't want to build my own from scratch. Does anyone have any suggestions????
    Thanks in advance,
    Louise.

    >
    PoolMan from www.codestudio.com was suggested but that
    doesn't seem to exist anymore.
    What about this
    http://sourceforge.net/projects/poolman

  • Help please, how to make movie play in nano

    i have a nano, i thought there should be a transfer software built-in,but no.
    anyone can give me this software pls?

    Hey there,
    First, make sure you have your iPod set up to sync videos. To do this, plug your iPod in and head over to the "Videos" tab and make sure they are set to "Sync" and hit "Apply" when you have selected your method for syncing videos. More on syncing videos can be found in the Apple document below.
    http://support.apple.com/kb/HT1333
    Also, make sure the video is in the standard iPod format. Even though it was bought from the iTunes store, it may not be in the correct iPod format. To change this, right->click (or control->click on a mac) on the movie in your iTunes library and choose "Create iPod or iPhone version." The conversion may take anywhere from a few minutes to quite some time depending on the length of the movie.
    Once it is done, try resyncing it to your iPod. Hope this helps.
    B-rock

  • Help on how to make an infinite loop with the same space on all images

    HI:
    I made a movie clip with infinite  loop in which there are images that move from right to left something simple like a marquee, and each image has a blank space between  them, but between last and first image there is a more space, how I can do to  make all images have an equal space between each one and that the motion never stops.

    Thanks for your time and answers my friend, but I'm still not be able to achieve what I want, I forgot to tell that I'm doing this by layers, let's say, I have 5 images, (in fact I have like 50 images converted to movie clip symbols) each image has it's own layer, layer 1, layer 2, layer 3, layer 4, layer 5, then I put a 200 frame motion tween on all layers at 30 fps, then I arranged layer 1 on the first frame to the frame 200, the second layer from frame 50 to frame 250, third layer from frame 100 to frame 300, fourth layer from frame 150 to frame 350, and fifth layer from frame 200 to frame 400, by this I mean I put a 50 frame of space on each image but if you can see, the last image has a duration from frame 200 to frame 400, and there's nothing on frame 250 where it is supposed to be another image to match the same blank space of all the others, the movie clip restarts on the frame 400, and there's a 150 frames of blank space between the last image and the first image, I put the gotoandplay on the frame 250, but it abruptly restarts the movie.
    Is there another way to do this ?
    Am I doing something wrong ?
    Please I really really need help on this.
    Thanks

  • How to create a connection pooling in Netbeans 6.0 using the oracle driver

    hi all,
    I am using Netbeans 6.0. Apache Tomcat 6.0.14 server, oracle 9i.
    I tried to create a connection pooling using tomcat web server.
    I have included the following code in context.xml and web.xml.
    CONTEXT.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/network1">
    <Resource name="jdbc/myoracle"
    auth="Container"
    type="javax.sql.DataSource"
    username="scott"
    password="tiger"
    factory="BasicDataSourceFactory"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:odbc:thin:@127.0.0.1:1521:mydb"
    maxActive="20"
    maxIdle="10"
    maxwait="-1"/>
    </Context>
    WEB.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    After that i have included the following JDBC driver's jar files in the $Catalina_Home/lib folder.
    classes 111.jar,
    classes 111_g.jar
    classes12.jar
    classes 12_g.jar
    classes12dms.jar
    classes12dms_g.jar
    nls_charset11.jar
    nls_charset12.jar
    ocrs12.jar
    ojdbc14.jar
    ojdbc14_g.jar
    Then i stop the tomcat web server and start it again.
    In jsp page i have included the following code:
    Context ctx=new InitialContext();
    Context envctx=(Context)ctx.lookup("java:comp:env");
    DataSource ds=(DataSource)envctx.lookup("jdbc/myoracle");
    Connection con=ds.getConnection(); ----->(In this line an error occured that Connection class cannot be found.)
    please help me how to create a connection pooling and rectify the error in conneciton.
    Thanks in advance

    Please refer
    http://www.netbeans.org/kb/60/web/customer-book.html

  • HEY, i have some issue i am using macbook air i5...the problem is that without doing anything 1.5gb of ram out of 2gb always in use ..please help me how to make it normal.

    HEY, i have some issue i am using macbook air i5...the problem is that without doing anything 1.5gb of ram out of 2gb always in use ..please help me how to make it normal....
    and my battery back up is max 3 to 3.5 hours in normal use with web ....is this normal or need some betterment!!!!

    ADEEL UR REHMAN wrote:
    ...the problem is that without doing anything 1.5gb of ram out of 2gb always in use
    No computer can do a thing without using memory. 1.5 GB is very little. It's normal.
    3 or so hours from a full charge may also be normal, for what you are doing. As batteries age, they don't last as long on a full charge as they did when they were new. All batteries eventually wear out, and are easily replaceable.

  • How to make gprs connected in a whole day without ...

    How to make gprs connected in a whole day without opening any internet surfing application in nokia x6 (16gb)?
    please help me...or how to keep gprs connection for long time...without any application opened...

    Dinhorocks wrote:
    How to make gprs connected in a whole day without opening any internet surfing application in nokia x6 (16gb)?
    please help me...or how to keep gprs connection for long time...without any application opened...
    Yes.. you may follow what jimmyireland has suggested... but just for curiosity and if you do not mind... why would you need this ???

  • I have a problem with iphone4 I bought a used and unlocked iphone4 old apple id because the first owner dies please help me how to activate iphone4 I unlocked with icloud

    I have a problem with iphone4
    I bought a used and unlocked iphone4
    old apple id because the first owner dies
    please help me how to activate iphone4
    I unlocked with icloud

    fherly nur arief wrote:
    I unlocked with icloud
    If you had already removed the device from 'Find My iPhone' in iCloud, then you jus tneed to powercycle the device in order to activate it.
    Source: http://support.apple.com/kb/TS4515
    "After the device is removed from the previous owner’s account, turn the device off by pressing and holding the Sleep/Wake button located on the top-right side of the device. Then restart your device and proceed with device setup as you would normally."
    If it has not been removed, then the activation lock is still active.
    If the previous owner cannot remove the device from their account there is nothing you can do unless the place you purchased it from will give you a refund.
    Activation Lock: http://support.apple.com/kb/ht5818
    What if I purchase a device that is still linked to the previous owner's account?
    Contact the previous owner as soon as possible and ask them to erase the device and remove it from their account. For complete instructions, read how to remove a device from a previous owner's account.
    How do I check for Activation Lock before purchasing a used device?
    When purchasing an iPhone, iPad, or iPod touch from someone other than Apple or an authorized Apple reseller, it is up to you to ensure that the device has been erased and is no longer linked to the previous owner’s account.
    Follow each of these steps to make sure that you can use the device you purchase:
    Turn the device on and slide to unlock.If the passcode lock screen or the home screen appears, the device has not been erased. Ask the seller to completely erase the device by going to Settings > General > Reset > Erase All Content and Settings. Do not take ownership of any used iPhone, iPad, or iPod touch until it has been erased.
    Begin the device setup process.After choosing a language, choosing a country, and connecting to a network, the device will begin activation. If you are asked for the previous owner’s Apple ID and password, the device is still linked to their account. Hand the device back to the seller and ask them to enter their password. If the previous owner is not present, they can remove the device from their account by signing in to icloud.com/find. Do not take ownership of any used iPhone, iPad, or iPod touch until it has been removed from the previous owner’s account.
    You will know that a device is ready for you to use when you are asked to “Set up your iPhone", “Set up your iPad", or “Set up your iPod” during the device setup process.

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

  • How to configure informix connection pool in sun-one appserver 7

    Hello,
    Anybody knows , How to configure informix connection pool properties in sun-one appserver 7?
    Thanks in advance.

    Actually,it couldn't get some advice in here.But now,I known how to configure it,I expended 2 days to search and test it.Follow :
    jdbc class:com.informix.jdbcx.IfxDataSource
    serverName=(INFORMIXSERVER)
    portNumber=1526(default)
    IfxIFXHOST=(host ip)
    databaseName=(your dbname)
    user=(your username)
    password=(your pwd)
    attention:configure right transaction and userthreads in your informix sever
    Hope helpful to someone!

  • All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though.

    All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though. WHATBCAN I DO TO MAKE MY APPS STOP CRASHING. I ALREADY TURNED IT OFF THEN ON AGAIN AN IT STILL CRASHES. HELPPP!!!!

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • Can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    I have same problem.
    However, I am unable to turn on Assistive Touch.
    At one time I was able to activate it, but it went away and now I cant reactivate.
    What is the solution?

Maybe you are looking for

  • Macbook problems, hard drive crash, random shutdown, freezes

    I bought my macbook used a few months ago, and it worked flawlessly until about 3 weeks ago. The system started freezing and not booting (getting folder icon instead of apple at startup). I ran drive setup and tried to repair the drive, but this did

  • Cannot type in Actions Frame

    I just created my first swf in Flash 8 Basic. Everything went great until I wanted to put a stop action at the end. Then I found that I couldn't type in the Actions Frame (displayed by pressing F9). I could enter the stop action by selecting it in th

  • Delete entries in "Installed Updates" log

    Is there anyway to delete entries in the "Installed software updates" log? I want to reinstall a firmware patch but although the patch downloads and says it has installed successfully it doesn't actually update anything... However, it shows up in the

  • Doubt on SAMPLE clause in SELECT statment

    Hi all, I am having table with rows of 41. I issued a statement like this select * from TABLE_NAME SAMPLE(10); and it selected 3 rows (it is varying) . Everytime, i issued this statement, it is fetching different number of rows. Can anybody please ex

  • Macbook Pro Retina 15 inch possible display/logic board issue?

    Ive had this problem when opening up FaceTime windows or notification center windows. the screenshot is provided (http://imgur.com/1h6fip4). i have run an apple hardware test the normal one and the extended one and it said it has no problems to repor