Connect JBOSS to MySQL using datasource,both servers are on different machi

HI,
In my application, I use JBOSS server and MySQL database.JBOSS and MySQL server are on two different machines.I am using mysql datasource,not driver manager to get the connection. i configured mysql-ds.xml and put it in %JBOSS_HOME%\server\default\deploy directory.
I have also put the mysql connector jar in the %JBOSS_HOME%\server\default\lib directory.
mysql-ds.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mysql-ds.xml 41016 2006-02-07 14:23:00Z acoliver $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<datasources>
<local-tx-datasource>
<jndi-name>JBossAtWorkDS</jndi-name>
<connection-url>jdbc:mysql://192.168.1.3:3306/JBossAtWorkDS</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>sa</user-name>
<password></password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
-->
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
code to make the connection is as follows...
public class JDBCCarDAO implements CarDAO
private List carList;
private static final String DATA_SOURCE="java:comp/env/jdbc/JBossAtWorkDS";
public JDBCCarDAO()
public List findAll()
List carList = new ArrayList();
DataSource dataSource = null;
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try
dataSource = ServiceLocator.getDataSource(DATA_SOURCE);
conn = dataSource.getConnection();
stmt = conn.createStatement();
stmt.execute("select * from CAR");
     rs = stmt.getResultSet();
while(rs.next())
CarDTO car = new CarDTO();
car.setMake(rs.getString("MAKE"));
car.setModel(rs.getString("MODEL"));
car.setModelYear(rs.getString("MODEL_YEAR"));
carList.add(car);
catch (Exception e)
System.out.println("No SQL connection is made"+e);
finally
try
if(rs != null){rs.close();}
if(stmt != null){stmt.close();}
if(conn != null){conn.close();}
catch(Exception e)
System.out.println(e);
return carList;
I am getting an error as follows...
No SQL connection is made.
org.Jboss.util.NestedSQLException:Could not create connection; -nested throwable: (java.sql.SQLException:Unable to connect to any host due to exception:java.net.ConnectException:Connection Time out:connect......
how to get rid of this problem????plz...someone help me....

If you have access to a copy of TimesTen 6.0 you can look in the AppServer Configuration Guide (appsrv.pdf) that was shipped with that release. This guide is currently being rewritten and so is not yet available for 7.0.
If you can't get hold of a copy, e-mail me at [email protected] and I'll send it to you.
Chris

Similar Messages

  • Connecting to multiple schemas using datasources file

    I am trying to connect to multiple oracle schemas on the same database using a 10.1.3 version of datasources.xml file. Has any one done this. If yes, can you please post an example.

    I am trying to connect to multiple oracle schemas on the same database using a 10.1.3 version of datasources.xml file. Has any one done this. If yes, can you please post an example.

  • Sharing contacts using AirDrop, both users are members of the same Family Sharing group.

    I'm asking this question for a friend of mine. He contacted me to help troubleshoot a problem where he was trying to share a contact with his wife using AirDrop. They both have new iPhone 5Ss running iOS 8.1. He can send a contact to his wife's iPhone but she can't send to him. While troubleshooting we noticed we could change the behavoir by changing the settings of who was a Parent/GardIan and who was an Adult in Family Sharing. For example we could change the behaviour so that she could share a contact with him but he could not share with her. We were never able to get it to work where they could share with each other both ways. It was one way only.
    Anyone else who is part of a Family Sharing group having trouble using AirDrop to share between iPhones, particularly contacts?

    Hi,
    The way to do this would be to first have a Lookup on the dimension based on the properties you want. You can then use this retrieved value in the REC statement.
    This is an example for it:
    *DIM CATEGORY=CATEGORY
    *DIM TIME=TIME
    *LOOKUP RATE
    *DIM ENTITY2="DEFAULT"
    *DIM RATE=ACCOUNT.RATETYPE
    *DIM SOURCECURR:INPUTCURRENCY=ENTITY.CURR
    *DIM DESTCURR1: INPUTCURRENCY="USD"
    *DIM DESTCURR2: INPUTCURRENCY="EURO"
    *ENDLOOKUP
    *WHEN ACCOUNT.RATETYPE
    *IS "AVG","END"
    *REC(FACTOR=LOOKUP(DESTCURR1)/LOOKUP(SOURCECURR),CURRENCY=u201DUSDu201D)
    *ENDWHEN
    *COMMIT
    Hope this helps.
    Santosh

  • Monitored service shows Healthy even when both servers are down

    I have set up monitoring on an web application. All of the components show Healthy State no matter what. We can shutdown some of the servers, stop the WWW Publishing service or other services and it still shows Healthy. I've checked the Event logs, restarted
    IIS when instructed.
    The only thing I can see as a possible issue is when I look at the State View for the application there is nothing in the APM ASP .NET Web Service Application Component column and nothing in the APM Windows Service Component column.  In other words
    they show as not monitored.  All of the other columns have green check marks.

    I think what you are seeing is by design. APM (as in ".NET Application Performance Monitoring" feature) WILL NOT tell you if the application is completely down. It will only tell you if it is throwing exceptions or responding SLOWLY.... but if
    it is totally down, APM is down WITH it and can't tell you anything about itself...
    You need to use other means to know those other issues:
    'Traditional' MPs (such as IIS's and BaseOS MPs) will tell you health issues with those layers
    'Synthetic' transactions such as those created with the Web Transaction or Web Availability Monitoring wizard
    OpsMgr by default alerts about missing heartbeats from agents and will tell you they went down...
    In the State View, you only see the components that are discovered - if you application 'lives' in IIS and is NOT a 'Windows Service', then it is normal not to see it as a 'Windows Service' - unless it is.
    I suggest you take a look at some older blog posts I wrote - for example that around APM Object model in OM
    http://blogs.technet.com/b/momteam/archive/2012/01/14/apm-object-model.aspx and the Alerting Rules
    http://blogs.technet.com/b/momteam/archive/2012/01/23/custom-apm-rules-for-granular-alerting.aspx

  • Failing Connecting PHP to MySQL with HTTP 404 NOT FOUND Error

    I'm using Dreamweaver CC to connect php to mySQL, and read both of these articles but still not working!
    1. It keep showing me HTTP 404 NOT FOUND. But I can access MySQL by web browser so I'm sure the address and login info is correct.
    2. There is no MMHTTPDB.php in my project folder.
    MMHTTPDB.php not creating
    http://forums.adobe.com/thread/1238828?tstart=0
    MySQL connection
    http://forums.adobe.com/thread/1239068?tstart=0
    Did I miss something?

    Thanks anyway but it is same as the thread I post below and above.
    MySQL connection

  • Could not connect to db using connectring from the server as different user

    Oracle Binary is installed under "oracle" user. if we login using different os user, we could not connect using connectr string.
    we set all env variables including TNS_ADMIN.
    tnsping fails with "TNS-03505: Failed to resolve name"

    Version: 11gR1
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    There is not problem in the tnsnames configuration. Because if I login as oracle then I can connect to the db using connectring. Developers are not able to connect from the server(Developer have unix account because they are loading data from sql*loader).

  • Connecting to a Mysql database using CF Administrator and DW

    I can't create a mysql datasource in CF Administrator.
    If I use the following datasource settings in CF
    Administrator:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Drive Class: MySQL Connector J
    AND (note the emphasis) I set my local and remote folders in
    my DW site local folder, remote folder and testing server folders
    all to C:\CFusionMX\db\, I can connect to my mysql database in CF
    Administrator.
    However, with these DW site folder settings, DW doesn't
    recognize any databases (Access or Mysql) at all.
    When I change my DW site folder settings to 'wwwroot'
    (e.g.local folder C:\CFusionMX\db\' is changed to
    'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
    databases.
    The problem is CF Administrator can't connect to my Mysql
    data sources. It gives me the error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    I've tried changing the 3306 port to 8500, but this doesn't
    help.
    My java path and connector file is:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
    Is this a ID/password problem? I've tried both 'root' and
    leaving the ID field in the CF Administrator add data source block,
    both to no avail. I don't have a password set in Mysql for 'root'
    either.
    Any help would be gratefully appreciated. I've been working
    on this for weeks and keep running into one problem after another.
    Thanks a million in advance.
    Sincerely,
    Graham A. Kerby

    1) ensure mysql server is running
    2) there are numerous tutorials for mysql installation out
    there
    3) there are good free mysql admin tools out there
    4) use both the above to verify your mysql installation is
    correct
    5) please tell me you do have your zonealarm DISABLED
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Connecting to a Mysql database using a ColdFusion server

    can't create a mysql datasource in CF Administrator.
    If I use the following datasource settings in CF
    Administrator:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Drive Class: MySQL Connector J
    AND (note the emphasis) I set my local and remote folders in
    my DW site local folder, remote folder and testing server folders
    all to C:\CFusionMX\db\, I can connect to my mysql database in CF
    Administrator.
    However, with these DW site folder settings, DW doesn't
    recognize any databases (Access or Mysql) at all.
    When I change my DW site folder settings to 'wwwroot'
    (e.g.local folder C:\CFusionMX\db\' is changed to
    'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
    databases.
    The problem is CF Administrator can't connect to my Mysql
    data sources. It gives me the error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    I've tried changing the 3306 port to 8500, but this doesn't
    help.
    My java path and connector file is:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
    Is this a ID/password problem? I've tried both 'root' and
    leaving the ID field in the CF Administrator add data source block,
    both to no avail. I don't have a password set in Mysql for 'root'
    either.
    Any help would be gratefully appreciated. I've been working
    on this for weeks and keep running into one problem after another.
    Thanks a million in advance.
    Sincerely,
    Graham A. Kerby

    If it were me I would use the MySQL JDBC driver and not ODBC. Then DSN versus not-DSN wouldn't be an issue.

  • Not able to connect to remote MySQL database using Connector/J

    I have an application that uses a connection pool for database access.
    It is initialized with this context.xml entry:
    The db server is running on port 3307.
         <Resource name="jdbc/DB" auth="Container"
                        type="javax.sql.DataSource" username="un" password="pw"
                        removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
                        driverClassName="com.mysql.jdbc.Driver"
                        url="jdbc:mysql://localhost:3307/myDB"
                        maxActive="8" maxIdle="4"/>Now after starting the context, I can see I have a connection to my database using the MySQL Administrator. So I know I am connecting.
    The problem is, when I try to query any table in the db, I get this message:
    java.sql.SQLException
    : Table myDB.TABLE_NAME' doesn't exist
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(
    MysqlIO.java:2921) ...
    I know it does in fact exist because I am looking at it. And the code I am using works perfectly fine as long as it is running on a local db server.
    Any ideas?

    I know it does in fact exist because I am looking at
    it. And the code I am using works perfectly fine as
    long as it is running on a local db server.
    Any ideas?Yes two.
    I am bit unclear about the last thing you said... you are testing with two different servers or two different clients?
    Anyway here are the possibilities off the top of my head.
    1) Some sort of security issue. Surrounding who and from where users can connect to the database in question.
    2) Case sensitivity problem. On Windows MYSQl makes all it's table names lower case only. Then it onlu supports the correct case to access them.
    For example
    CREATE TABLE TestMe
    Can then only be accessed with
    SELECT * FROM testme
    Not TestMe.
    This appears to vary with version but i have seen this issue before.

  • Connecting to TimesTen using DataSource in WebLogic on Linux

    We are trying to use weblogic 9.2 to connect to TimesTen7.0, both are on Linux.
    We have installed Oracle 10g client and then installed TimesTen 7.0 Client on the Linux server hosting weblogic.
    Created Client DSN in /var/TimesTen/sys.odbc.ini file as follows:
    [ODBC Data Sources]
    TTclientMaster=TimesTen 7.0 Client Driver
    [TTclientMaster]
    TTC_SERVER="TTServerHostName"
    TTC_SERVER_DSN=TTmaster
    When we are trying to create DataSource in weblogic Admin console it does not show up TTClient Driver in the list.
    We tried setting up using "Others" for driver and databasetype but then it asks for databasename which we don't have since TT uses DSN.
    We are looking for any pointers or references that can explain how to configure weblogic to use TimesTen using TT 7.0 client DSN.

    If you have access to a copy of TimesTen 6.0 you can look in the AppServer Configuration Guide (appsrv.pdf) that was shipped with that release. This guide is currently being rewritten and so is not yet available for 7.0.
    If you can't get hold of a copy, e-mail me at [email protected] and I'll send it to you.
    Chris

  • Connect to mysql without datasource

    Good day every body.
    Im sure this is possible but i dont know how.
    I need to connect to a mysql database without creating a
    datasourse.
    I need the query code please.. if i need to install a driver
    on the server or create a dynamic datasourse. i can..
    Regards

    > Well i want do create sites that can connect to a mysql
    server dynamically
    > from settings changed in the application.cfm file.
    > So that different people can just change there ip
    without having to create the
    > datasource.
    Well <cfquery> tags and <cfstoredproc> tags
    require a datasource, don't
    they.
    So how are you expecting to use them without one?
    You COULD - quite easily - just use Java to communicate with
    the JDBC
    drivers, which would not require a DSN being defined, but it
    would mean not
    using CF's in-built database interactivity tags.
    I don't really understand why you think it's bad to have a
    datasource? Can
    you expand on your idea so I understand what you're trying to
    achieve?
    Adam

  • Using Datasource in OC4J  to connect to 9iDb(ArrayIndexOutOfBoundsException

    Hi all,
    I've been encountering a certain ArrayIndexOutOfBoundsException when attempting to connect to Oracle 9i
    via a defined datasource.
    I've taken the following troubleshooting steps but to no avail:
    1. Verified username and password
    2. Verified URL by having a test class to establish a direct connection using this URL
    3. Verified that both classes12.jar and ocrs12.jar are defined in the classpath
    3. Updated classes12.jar and ocrs12.jar from the OTN to copies stipulated to be compliant with 9.2.0.1
    (this was based on a post on the net with reference to similar error messages:http://www.orafaq.net/msgboard/java/messages/1488.htm)
    It would be great if anyone could have some input on this problem.
    Thanks!
    WK
    My development environment:
    Oracle Database 9.2.0.1
    oc4j
    The following configuration and code snippets are provided for reference:
    data-sources.xml
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="OraclePool"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="USER"
              password="PASSWORD"
              inactivity-timeout="30"
              url="jdbc:oracle:thin:@localhost:1521:OracleDb"
    />
    Client Code:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource)ic.lookup("jdbc/OracleDS");
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    String strQuery = "SELECT id FROM TBL_PART";
    ResultSet rset = stmt.executeQuery (strQuery);
    Error:
    java.lang.ArrayIndexOutOfBoundsException
         at oracle.security.o3logon.C1.r(C1)
         at oracle.security.o3logon.C1.l(C1)
         at oracle.security.o3logon.C0.c(C0)
         at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
         at oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:118)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.DriverManagerConnectionPoolDataSource.getPooledConnection(DriverManagerConnectionPoolDataSource.java:24)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.OrionPooledDataSource.getPooledConnection(OrionPooledDataSource.java:273)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.PooledConnectionUsage.getPooledConnection(PooledConnectionUsage.java:21)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.OrionPooledDataSource.getConnection(OrionPooledDataSource.java:145)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.DriverManagerXADataSource.getAutoCommitConnection(DriverManagerXADataSource.java:226)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.LogicalDriverManagerXAConnection.intercept(LogicalDriverManagerXAConnection.java:88)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.FilterConnection.createStatement(FilterConnection.java:324)
         at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].sql.FilterConnection.createStatement(FilterConnection.java:325)

    Hi WK,
    According to your stack trace, you are using a very old version of OC4J. I suggest updating to the latest, production version: 9.0.3
    Also, I seem to recall reading somewhere (I think it was in this forum), that "DataSource" is not serializable, and therefore cannot be transferred to the client.
    I use "DataSource" in my BMP entity beans to interact with the database -- this works fine. I have not tried getting a "DataSource" from a remote client, though.
    And also you may need to pass some "properties" to your "InitialContext" constructor -- depending on the type of client you are using (which I could not ascertain from your post).
    Hope this has helped you.
    Good Luck,
    Avi.

  • Help me understand JDBC connections using DataSource objects

    I'm writing a simple Java server application that accepts connections from multiple clients via RMI, connects to a SQL Server 2000 database via Microsoft's SQL 2000 JDBC driver, gets some data, and returns it to the client. The server application will handle every SQL database connection. However, it must be able to establish multiple simultaneous connections, since multiple clients may connect at the same time and request data.
    Sounds like a simple multi-threaded server that utilizes a connection pool for database connectivity, right? Well, if I want to do that, I have to register a PooledDataSource object with JNDI. My server threads that are handling requests will simply grab connections out of the pool to retrieve data (presumably).
    This seems like a fairly simple server application; however, all the information and tutorials I've read on using DataSource objects for database connections rather than DriverManager.getConnection() mention XML config files, J2EE application servers, Tomcat, WebSphere, etc. I really don't want to have to deal with all that just to get connection pooling and not have to use the DriverManager.getConnection() method.
    Is there a simple way to use DataSource objects without installing a lot of extra junk on my server?

    Thanks, diazlara. Your response was exactly what I needed to know. All the information I've read prior to this suggested that I had to have a J2EE server running, and that I had to register the DataSource object with JNDI. If you ladies and gents could take a quick look at this and let me know if I'm doing it correctly, I'd appreciate it.
    As proflux suggested, I wrote a connection manager:
    import java.sql.*;
    import javax.sql.*;
    import com.microsoft.jdbcx.sqlserver.*;
    public class SQLConnectionManager {
       private static ConnectionPoolDataSource connectionPool;
       // Initialize the connection manager
       public SQLConnectionManager() {
          init();
       // Retrieve a connection from the connection pool and return it
       public static Connection getConnection() {
          Connection connection = null;
          try {
             connection = connectionPool.getPooledConnection("myUsername", "myPassword").getConnection();
          catch (SQLException ex) {
             System.err.println("A problem occurred while getting a connection from the pool.");
             ex.printStackTrace();
          return connection;
       // Initialize the datasource and connection pool
       private static void init() {
          SQLServerDataSource mds = new SQLServerDataSource();
          mds.setDescription("MS SQLServerDataSource");
          mds.setServerName("127.0.0.1");
          mds.setPortNumber(1433);
          mds.setDatabaseName("SomeTable");
          mds.setSelectMethod("cursor");
          connectionPool = (ConnectionPoolDataSource) mds;
    }As you can see, I'm hard-coding the username and password for testing purposes. I'll incorporate a login/authentication system for any production code that I use this in.
    Once the SQLConnectionManager is created, connections can be retrieved as follows:
          Connection connection = null;
          try {
             connection = SQLConnectionManager.getConnection();
             System.out.println("** Got a SQL database connection from the pool");
             DatabaseMetaData metaData = connection.getMetaData();
             ResultSet rs = metaData.getCatalogs();
             while (rs.next()) {
                System.out.println("\tcatalog: " + rs.getString(1));
             rs.close();
             connection.close();
          catch (SQLException ex) {
             System.out.println("An exception occurred while connecting to the SQL Database:");
             ex.printStackTrace();
          }So, how does that look? I tested it out, and it seems to work just fine. Using this code, I am getting a connection from a pool, correct? I want to make sure of that. Also, are there any inherent weaknesses or flaws with this method that I need to be aware of?
    Thanks so much for all the helpful responses.

  • TS1424 everytime i try to download an app from itunes, or to 'view all' the apps listed, the error says; 'We could not complete your iTunes Store reuest. The network connection was reset' I used both my desktop and laptop both on Windows 7 Pro, & net is f

    everytime i try to download an app from itunes, or to 'view all' the apps listed, the error says; 'We could not complete your iTunes Store reuest. The network connection was reset' I used both my desktop and laptop both on Windows 7 Pro, & net is fine. please help. is there soemthing wrong with apple store temporarily?

    The latest message is: 'We could not complete your iTunes Store request. The network connection was reset.'
    In between, I got a messge about verifying my payment method. When I tried to submit the details, I kept getting a mmessage stating that my payment method was declined (my card is not near it's expiration date, and works fine).
    Argh!

  • Can't Connect to the Mysql Database using J2SE jdk1.5

    Can anyone tell me why this error occurs ????????????????????
    Following are the codes ;
    package dbconnect2;
    import java.sql.*;
    public class dbconn2 {
    public static final String URL =
    "jdbc:mysql://localhost:3306/test";
    public static final String USERNAME = "test";
    public static final String PASSWORD = "password";
    * @param args the command line arguments
    public static void main(String[] args) throws Exception {
    // TODO code application logic here
    Connection connection = null;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(URL,
    USERNAME, PASSWORD);
    Statement stm = connection.createStatement();
    ResultSet rs = stm.executeQuery("select * from emp");
    while (rs.next())
    String strnaam = rs.getString("emp_name");
    System.out.println(strnaam);
    finally {
    if (connection != null)
    connection.close();
    ================================================================================
    This is the run time error ;
    init:
    deps-jar:
    compile:
    run:
    Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at dbconnect2.dbconn2.main(dbconn2.java:39)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    please help me to sort this out
    Thanks
    Sishani

    I've solved the DW problem by changing the site folders from
    'db' to 'wwwroot' e.g. 'C:\CFusionMX\db\' is now
    'C:\CFusionMX\wwwroot\
    However I'm now back to my original problem. I've lost my
    mqysql connection in CF Adminstrator. Before I made these changes I
    could connect to my mysql databases using the following settings:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Driver Name: MySQL Connector J
    using the following Java path and file:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar
    Now these settings give me the following error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    Any suggestions on this would also be welcome.
    Thanks again to everyone for their help.
    Sincerely,
    Graham A. Kerby

Maybe you are looking for