MySQL database overflow??

I am using a MySQL database which contains data on bankaccounts. For example, person X has 4 accounts. These accounts are listed in a selectbox. By clicking on one of the accounts, the page is refreshed with the account ID. When an ID is set, more details about the account are displayed.
To retrieve the data, I am using a bean which has been created with a wizard. I have done some minor changes, but not to the database connection and processing of the query. It works properly, but I have the idea it opens more database connection than it should (ok, Im a Java n00b so I do not really know where to look).
The following error occurs when I select the 4 different accounts of person X a few times after eachother. I do this randomly, but after about 13 of 14 clicks, I get an error.
[4/4/03 13:28:43:436 CEST] 49e202dc WebGroup      E SRVE0026E: [Servlet Error]-[Server configuration denies access to data source]: java.sql.SQLException: Server configuration denies access to data source
     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java(Compiled Code))
     at com.mysql.jdbc.Connection.createNewIO(Connection.java(Compiled Code))
     at com.mysql.jdbc.Connection.<init>(Connection.java:485)
     at com.mysql.jdbc.Driver.connect(Driver.java:341)
     at java.sql.DriverManager.getConnection(DriverManager.java(Compiled Code))
     at java.sql.DriverManager.getConnection(DriverManager.java:194)
     at com.ibm.db.db.base.DatabaseConnection.connectToDataSource(DatabaseConnection.java)
     at com.ibm.db.db.DatabaseConnection.connect(DatabaseConnection.java)
     at com.ibm.db.db.Statement.connect(Statement.java)
     at com.ibm.db.db.SelectStatement.execute(SelectStatement.java)
     at com.ibm.db.beans.DBSelect.execute(DBSelect.java)
     at ClientDataBean.execute(ClientDataBean.java:43)Does anyone know by this error what the problem is? As I said, I believe it has something to do with open database connections. But as it is a wizards code, I dont really know what to change.

Yes, the problem was that the database was explicitly denying access, and your Bean could not handle that.
As guessed elsewhere, you probably had too many connections, and the database thought you might be trying to hack in so it panicked and closed off access.
The next time you do maintainence (don't bother now, since it's working, but on the next rainy day), you may want to add a try...catch clause that sends a proper error message to the user, something along the lines of "You have made too many attempts to fetch the data. Being security concious, we ask that you wait a few minutes before you try again".

Similar Messages

  • 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.

  • Can't connect a servlet to a mysql database (jdbc)

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class LoginServletJDBC extends HttpServlet{
         public void doGet(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException{
              sendLoginForm(response,false);     }
         public void sendLoginForm(HttpServletResponse response,boolean error)
         throws ServletException,IOException{
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html><head>");
              out.println("<title>Login</title>");
              out.println("</head>");
              out.println("<body>");
              out.println("<center>");
              if(error)
                   out.println("<b>Failed login. Please try again</b>");
              out.println("<br><br>");
              out.println("<h2>Login page</h2>");
              out.println("<br>Please enter your username and password");
              out.println("<br><br>");
              out.println("<form method=post>");
              out.println("<table>");
              out.println("<tr>");
              out.println("<td>Username : </td>");
              out.println("<td><input type=text name=userName></td>");
              out.println("</tr>");
              out.println("<tr>");
              out.println("<td>Password : </td>");
              out.println("<td><input type=password name=password></td>");
              out.println("</tr>");
              out.println("<tr>");
              out.println("<td align=right colspan=3>");
              out.println("<input type=submit value=Login></td>");
              out.println("</tr>");
              out.println("</table>");
              out.println("</form>");
              out.println("</center>");
              out.println("</body></html>");
    public void doPost(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException{
              String userName = request.getParameter("userName");
              String password = request.getParameter("password");
              if(login(userName,password)){
                   RequestDispatcher rd = request.getRequestDispatcher("AnotherServlet");
                   rd.forward(request,response);
              else{
                   sendLoginForm(response,true);
         boolean login(String userName,String password){
              try{
                   String url = "jdbc:mysql://localhost:3306/Users";
                   Class.forName("com.mysql.jdbc.Driver");
                   Connection con = DriverManager.getConnection(url,"root","");
                   //System.out.println("got connection");
                   Statement s = con.createStatement();
                   String sql = "select userName from Users where userName='"+userName+"and password='"+password+"';";
                   ResultSet rs = s.executeQuery(sql);
                   if(rs.next()){
                        rs.close();
                        s.close();
                        con.close();
                        return true;
                   rs.close();
                   s.close();
                   con.close();
              catch(ClassNotFoundException e){
                   System.out.println(e.toString());
              catch(SQLException e){
                   System.out.println(e.toString());
              catch(Exception e){
                   System.out.println(e.toString());
              return false;
    }so ...
    here i'm trying to connect to Users mysql database (i use Tomcat 4.1 and mysql servers and clients 4.0.1-alpha)
    where is the problem ? when i run this servlet (http://localhost:8080/example/servlet/LoginServletJDBC ) it works ;
    BUT when i type an username and a password (any user&pass) my servlet doesn't connect to the database (become a infinite loop without output ; i mean no any errors and exceptions)
    i try other think : i changed the database with unexisting database and the result was that i was expected (Unknow database 'unexistingdatabase' )
    what i miss ?
    please... can anyone help me...
    thank`s in advance

    The wireless security setting that the Actiontec modem/router is using may be different...and not compatible....than the setting that the Comcast product was using.
    If you think that might the case, and you have the time to troubleshoot......
    Temporarily, turn off the wireless security on the Actiontec modem/router
    Reset an AirPort Express back to default settings, then see if it will connect using no security and allow an Internet connection when you do the Ethernet port test in the post above again.
    If the AirPort Express cannot connect correctly using no security on the wireless network.....then it is a no brainer to know that it will never connect when security is enabled.  So, if the AirPort will not connect using no security, you may have an incompatibility issue between the Actiontec and Apple products.
    However, if the AirPort Express connects OK with no security, then this tells you that you will need to use a different setting for security on the Actiontec...the same that the Comcast router was using before.....so the Express will have a better chance of connecting.
    That setting would be something like WPA/WPA2 Personal, or the same setting stated another way would be WPA-PSK-TKIP.

  • Access to MySql Database in the Web Service

    Hi all,
    In my j2me web service project, i want to access to MySql database in the web service and
    my installation is
    Tomcat 5.0 for Java WSDP,
    Java Web Services Developer Pack 1.5,
    MySql Server 5.0 and environment variables are adjusted...
    server.xml where is in "C:\tomcat50-jwsdp\conf" is adjusted like this
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <Realm className="org.apache.catalina.realm.JDBCRealm"
         debug="99"
         driverName="com.mysql.jdbc.Driver"
         connectionURL="jdbc:mysql://localhost:3306/erendb"
         connectionName="root"
         connectionPassword=""
    />
    but i have not access to MySql database in the web service yet...
    please help...

    Hi Luis,
    If you see closely, the productID is actually a concatenation of the areaID and the productID. The reasoning here is that a product can be in multiple nodes of the product catalog and one would need to specify the product on a particular node for the direct URL to work.
    On a client site, we came up with a better solution by creating a new FM to retrieve the specific areaID and productID for a product. This FM could be called by extending the webshop. Then a .NET program was written to re-direct a shortened form of the URL to the long URL and therefore the specific product in the product catalog. Eg.: http://yyyyy.com/b2c/b2c/product would be automatically redirected to http://yyyyy.com/b2c/b2c/init.do?shop=<shop name>&areaID=<area Guid>&productID=<product Guid>, something similar to the concept behind "tinyurl.com". A point to remember here is that this would work only for the B2C webshop.
    Hope this helps.
    Cheers,
    Ashok.

  • Problem with inserting data into mySQL database with jsp

    I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/connection.jsp" %>
    <%
    // *** Restrict Access To Page: Grant or deny access to this page
    String MM_authorizedUsers="";
    String MM_authFailedURL="login_form.jsp";
    boolean MM_grantAccess=false;
    if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
      if (true || (session.getValue("MM_UserAuthorization")=="") ||
              (MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
        MM_grantAccess = true;
    if (!MM_grantAccess) {
      String MM_qsChar = "?";
      if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
      String MM_referrer = request.getRequestURI();
      if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
      MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
      response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
      return;
    String vehicle_details__registration = null;
    if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
    String vehicle_details__make = null;
    if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
    String vehicle_details__model = null;
    if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
    String vehicle_details__colour = null;
    if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
    String vehicle_details__tax_class = null;
    if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
    String vehicle_details__chasis_num = null;
    if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
    String vehicle_details__status = null;
    if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
    String owner_details__MMColParam = "1";
    if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
    Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
    Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    vehicle_details.executeUpdate();
    %>
    <form name="add_vehicle_form" id="add_vehicle_form">
      <p>Registration mark:
        <input name="txt_registration" type="text" id="txt_registration">
    </p>
      <p>Make:
        <input name="txt_make" type="text" id="txt_make">
    </p>
      <p>Model:
        <input name="txt_model" type="text" id="txt_model">
    </p>
      <p>Colour:
        <input name="txt_colour" type="text" id="txt_colour">
      </p>
      <p>Tax Class:
        <select name="select_tax_class" id="select_tax_class">
          <option value="AAA">Band AAA (up to 100g/km)</option>
          <option value="AA">Band AA (101 - 120g/km)</option>
          <option value="A">Band A (121 - 150g/km)</option>
          <option value="B">Band B (151 - 165g/km)</option>
          <option value="C">Band C (166 - 185g/km)</option>
          <option value="D">Band D (Over 185g/km)</option>
        </select>
      </p>
      <p>Chasis Number:
        <input name="txt_chassis_num" type="text" id="txt_chassis_num">
    </p>
      <p>Status: active:
        <input name="radio_status" type="radio" value="1" checked>
        off-road
        <input name="radio_status" type="radio" value="0">
      </p>
      <p>
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    Connvehicle_details.close();
    %>This is the error I am getting from the server
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any help would be much appreciated.
    Thanks

    use this ...
    PreparedStatement vehicle_details =
    Connvehicle_details.prepareStatement("INSERT INTO
    vehicle_man_db.vehicle_details (registartion, make,
    model, colour, tax_class, chasis_num) VALUES
    vehicle_details .setString(1,String
    vehicle_details__registration );
    vehicle_details setString(2,String
    vehicle_details__make );
    vehicle_details .setString(3,String
    vehicle_details__model );
    vehicle_details .setString(4,vehicle_details__colour
    vehicle_details .setString(5,String
    vehicle_details__tax_class);
    vehicle_details .setString(6,String
    vehicle_details__chasis_num );
    vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error.

  • Problem with connection in Mysql database in struts application

    Helllo
    i've just started learning struts for my new project where i'm having problem in accessing mysql database
    the datasource being defined in struts-config.xml is as follows:
    <data-sources >
        <data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
          <set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
          <set-property property="user" value="root" />
          <set-property property="password" value="" />
          <set-property property="minCount" value="" />
          <set-property property="maxCount" value="" />
          <set-property property="description" value="A" />
          <set-property property="url" value="jdbc:mysql:///dnbotind_nbotdb" />
          <set-property property="readOnly" value="false" />
          <set-property property="autoCommit" value="true" />
          <set-property property="loginTimeout" value="" />
        </data-source>
      </data-sources>as i run the application
    it gives the errors HTTP status 404-Servlet action is not available
    Thx in advance

    student-java wrote:
    it gives the errors HTTP status 404-Servlet action is not availableThis is unrelated to the datasource configuration.
    HTTP 404 is a "Page not found" error. The request URL is simply wrong. Either there's a typo in the URL, or there is a typo in the servlet mapping, or the servlet is not there where you think.

  • I can't get my website to connect to mysql database hosted on my yahoo site

    I used David Powers tutorials to build a CMS website in Dreamweaver using a testing site set up on my computer. I installed XAMPP and got it working on my computer. (I have a Windows 7 PC with Dreamweaver CS6)
    Now I have installed the mysql database on my remote site following the instructions in the help section of Yahoo Small Business, where my website is hosted. I recreated the same database on the myPHPAdmin on my remote site. (If I understood what I found out when searching for a solution, Yahoo doesn't allow me to see the database from Dreamweaver. It seems that I have to make sure the connections are correct and then upload my site to the remote server. Then it should work once up)
    Following the instructions I could find on Yahoo it seems that all I needed to do was make sure that the user name and password were the same as on my local computer and change the my Sql Server in the Server Connection in Dreamweaver CS6 to mysql instead of localhost, upload my website and it should connect. When I go to my webpage online I get "No database selected".
    I know html, css, some php, and mysql.
    I have been using Dreamweaver for approximatley 2 years and have created 2 successful websites for my husband, who is a photographer. He now wants to have a blog type news website and since I couldn't get Wordpress to do what he wanted to do I decided to create a CMS website. It works great on my computer, but now I need it to work on my remote site.
    I know it's probably something really stupid that I have overlooked and I would really appreciate any help I could get.
    I'm more than happy to learn whatever I need to learn to get this done. I have been searching all kinds of forums and I can find a lot of posts about this or a similar problem, but no solutions.
    Please let me know if I need to provide more information.

    I'm sorry, the way I wrote that was confusing. In mysql it suggested you create a new user that had limited access to access each database you created, rather than use the root user which had all permissions. So in both the mysql on my computer and the mysql on my website I created a user with the same username and password, so that when my website was on my remote server the username and password were the same as when I was testing it on my local computer.
    SnakEyez02 wrote:
    Following the instructions I could find on Yahoo it seems that all I needed to do was make sure that the user name and password were the same as on my local computer and change the my Sql Server in the Server Connection in Dreamweaver CS6 to mysql instead of localhost, upload my website and it should connect. When I go to my webpage online I get "No database selected".
    Just looking at that part of your response, I don't get what they are asking you.  Typically the remote host will require that you update the username/password and possibly SQL server.  When you are in most shared environments, which is what I presume you are in, you typically have a username that is prefix_username.  So you should be updating your script to match that information, not the other way around.  Also with the "mysql instead of localhost" comment, you would only change the script from localhost to another server (ip address) if the mySQL server is not on your web server.  If you host tells you this is true thent he value should be an IP address instead of localhost.  Is that the case?
    For the second part of your question in the "Why can't I access my database" help on Yahoo it says "If your PHP or Perl configuration files require a host name, you may have a problem with your host name. Make sure that you are using the host name mysql, not the default host name localhost." I assumed that meant that in the setup menu when establishing a server connection I needed to replace "localhost" as the mysql Server with "mysql" and then upload my website. This didn't work. Since the mysql server I am trying to access can be accessed using phpmyadmin at www.mywebsite.com/phpmyadmin this seemed to make sense to me. I think I might have managed to access the mysql server, but I'm not choosing the database I want correctly.

  • MySQL Database Connection (two databases at the same time)

    I have never had to open more than one MySQL database from within the same website before, but I do now.  The website I have is designed where all the content comes from within the main database.  I am building an Inventory system that I want within it's own database, in the event I would ever need to move the application to another server or something, I don't want this data residing in the main database.
    Currently, I open the database connection from within a file called "common.php" that resides in a directory called "lib" that can be accessed from the root directory.  Below is the proposed code that would be placed within the "common.php" file:
    // Define Database Variables
    $dbserver = "127.0.0.1";
    $dbuser  = array('clevelan_user1', 'clevelan_user2');
    $dbpass  = array('P@ssw0rd', 'P@ssw0rd2');
    $dbname  = array('clevelan_database1', 'clevelan_database2');
    // Start Session
    session_start();
    // Connect to Databases
    connectdb($dbserver, $dbuser[0], $dbpass[0], $dbname[0]);
    connectdb2($dbserver, $dbuser[1], $dbpass[1], $dbname[1]);
    // Database 1 Connection
    function connectdb($dbserver, $dbuser, $dbpass, $dbname) {
    // connects to db
      global $connection;
      $connection = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
      $db = @mysql_select_db($dbname, $connection) or die ("could not select databsase");
      return $connection;
    // Database 2 Connection
    function connectdb2($dbserver, $dbuser, $dbpass, $dbname) {
    // connects to db
      global $connection2;
      $connection2 = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
      $db2 = @mysql_select_db($dbname, $connection2) or die ("could not select databsase");
      return $connection2;
    //End of Code Within the "common.php"
    From within any page of the website, I want to access both connections by placing an include at the top of each page:
    include_once("lib/common.php");
    Currently, when I run the code above, any page within the website (the home page) provides error messages with regards to database connectivity (the pages are looking for there content from within the second database.  It's as if the second database is the only database seen by the website.
    I need help figuring out how I can have two MySQL databases open at the same time (the second database will only be open for short periods of time and then closed).  But the main database is always open.

    Create one project using one copy of the exact tables.
    create 2 different sessions.xml files each pointing to the same project. Set the login information in the sessions.xml files.
    That should work fine.
    Peter

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How to get data into the mySQL database?

    First some background.
    I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
    There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
    A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
    Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
    These were my initial thoughts:
    1. Data collection:
    To avoid spending all our energy and time  on correcting typo's, getting missing data, correcting errors, I am  investigating the use of CPU-Z in Ghost mode to create a .txt or .html  file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds  data like number of memory sticks, DDR timings, stock clock speed and  BCLK setting, video card info and VRAM size, etc.
    To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
    This can all be done without user intervention in an automatic way, but  maybe I need to add an Auto-It file to the test to make it all run as  desired.
    If this works and I'm able to extract the relevant data from the created  file and can insert it into the database, we may be in business for the  next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot  easier, because there is less data to fill out.
    2. Data submission:
    The submission form can be simplified if  the CPU-Z data can be used. We have to create an automatic way to attach  the created .html file from CPU-Z to the submission form and we have to  streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It  currently is manual labor and very time consuming.
    3. Adding to Database:
    I have to find a way to create database  records from the Gmail forms I receive. All incoming mail messages need  to be checked on relevancy and if relevant, need to be added  automatically to the database and then offered for approval before final inclusion in the database. Data included in the database  will then include submission date and time, Email address,  IP address  used, plus links to the files submitted and available on the website.
    4. Publication of the database:
    After approval of new records from step  3, all updates will be automatically applied to the database and  accessible for users. I do not yet intend to introduce a user account ,  requesting login before all functionality is accessible. Too much trouble and administration.
    Queries should be possible on things like CPU (check box), so include  17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory  (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar  options.
    The biggest problem is to keep the color grading and statistical  indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated  queries. Say you make a query which results in 20 observations, this  should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends  do need to reflect that. Question in my mind, does the RPI remain  constant, independent of the query or does that need to be recalculated  on the basis of the query?
    Next thing is to allow a user to select a specific observation and by  simply clicking on it be shown, in a separate window (detail page) or  accordion, all the CPU-Z related information about the hardware.
    The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
    5. Ideally, external links:
    In an ideal situation, one could link the  CPU-Z data to external price databases, looking up current prices for  CPU, memory, video card, disks, raid controller, etc. to get instant  BFTB charts, based on the query made. But that is the next step.
    Situation now:
    I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
    Question:
    I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
    "Ref_ID","-","filename"
    Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
    20110204-6cf5-Output(99).txt
    I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
    Graphically,
    is what I want to achieve.
    This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
    Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
    I hope someone can help me.

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • How to store file content in BLOB field MySql database using java

    Hi!
    i want to store the file content in a BLOB field in MySql database using java.
    Please help me out..........
    thanx in advance...
    bye

    i stored images in db, and retrieved them. like that cant i store pdf file in db, and retrieve it back using oracle db?
    Plz help me out how to put a file in db. i need complete code. thanks in advance.

  • What should i do with an Oracle 11g Database, MySQL database and a dump file.

    I just joining to a new work field, almost about a database and i know "NOTHING" about this field.
    My company has a system that running by Oracle Database, the problem is that Oracle Database will cost a lot of money when my company expands.
    So the quest is converting Oracle Database to MySQL database.
    Of course i cant try to convert it in the main Database, so i create one Oracle 11g Database on my LocalHost, and it already actived in " Localhost:1158 " etc.
    I have another Sever test that already set up MySQL database, and a dump file from the system.
    So I want to ask these 2 questions :
    1. How to create an new Oracle Database from that dump file ?
    2. Is it alright if i use tool to convert Oracle Database into MySql, or i should do it manually ?
    Thanks alot.

    I just joining to a new work field, almost about a database and i know "NOTHING" about this field.
    My company has a system that running by Oracle Database, the problem is that Oracle Database will cost a lot of money when my company expands.
    So the quest is converting Oracle Database to MySQL database.
    I predict that converting to MySQL will cost your company more as it expands. As you expand managing contention becomes more important - Oracle does this for you. I do not think MySQL does, so you'll have to write more code to deal with this, costing the company money. A big part of making application scalable and reliable is to use stored procedures, how good are MySQL's compared to PL/SQL's. What other features are there that MySQL has that will benefit your company that Oracle doesn't. What do you need to think about as your company expands that need to be taken care of in the database. I would have thought a migration from MySQL to Oracle would be more common to deal with expansion.
    As you know "NOTHING" you need to think about what each database can give you for the next 10 years to cope with you businesses potential requirements, and extimate how much it will cost to implement these requirements, then make the decision

  • I can't connect to MySQL database from The JSP Standard Tag Library

    Hi All !
    I have a problem, please help me anybody !
    I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
    I have in folder�WEB-INF/lib� following files:
    antlr.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mysql-connector-java-3.1.13-bin.jar
    standard.jar
    struts.jar
    I'm using:
    NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
    Ent.Pack 20061020 Visual Wb Pack 061103
    OS WinXP SP2
    Java 1.5.0_10
    MySQL 5.0.18-nt
    1:<%@page contentType="text/html"%>
    2:<%@page pageEncoding="UTF-8"%>
    8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    10:
    11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    12: "http://www.w3.org/TR/html4/loose.dtd">
    13:
    14: <sql:setDataSource var="ds"
    15: driver="com.mysql.jdbc.Driver"
    16: url="jdbc:mysql://localhost:3306/test"
    17: user="root"
    18: password="xxxx"/>
    19:
    20:
    21:<sql:query sql="select name, age from People" var="res"
    22: dataSource="${ds}"/>
    I have received report on mistake when entered code at the top:
    �/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
    I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
    After build and run I have received
    =========================================START=================================
    HTTP Status 500
    type Exception report:
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17
    =======================================END================================
    Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
    BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
    I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
    I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
    There is idea how can resolve this problem
    Thank you in advance ;)

    For all how have similar problem.
    Decision instead of these ways
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    it is necessary to indicate these
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  • 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