JSP and DB2 Connection

I tried to use this class in my jsp page to connect to the DB2 database, However, no data from the DB appears on the page and i get no errors whatsoever. Can anyone be kind enough to take a look? Thanks
package WH;
import java.sql.*;
import java.sql.Statement;
public class DbConnect1 {
private String dbUser = "XXX";
private String dbPasswd = "XXX";
private String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
private String dbURL = "jdbc:db2:http://xx.xx.xxx.xx:8080/invsys";
private Connection dbCon;
public DbConnect1(){}
public boolean connect() throws ClassNotFoundException,SQLException{
try
Class.forName(dbDriver);
System.out.println("Loaded the instantDB JDBC driver.");
dbCon = DriverManager.getConnection(dbURL, dbUser, dbPasswd);
System.out.println("Created and connected to database TimingTest");
return true;
catch (Throwable e)
e.printStackTrace();
System.out.println("FAIL LAHHHHHHHHHHHH");
return false;
public void close() throws SQLException{
dbCon.close();
//accepts the SQL query in the form of a string from the JSP file in which this bean is implemented
public ResultSet execSQL(String sql) throws SQLException{
System.out.println("haha");
//initiates the connection with the dbCon connection object
Statement s = dbCon.createStatement();
ResultSet r = s.executeQuery(sql);
return (r == null) ? null : r;
public int updateSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
int r = s.executeUpdate(sql);
return (r == 0) ? 0 : r;

Here is a copy of my JSP file.
<%@ page language='java' %>
<%@ page import="java.sql.*" %>
<jsp:useBean id="DbConnectBean1" scope="page" class="WH.DbConnect1" />
<%
     //Get status
     /*String message;
     String status = request.getParameter("status").trim();
     if (status == "duplicateEmail")
     message="Please try again. An account with the same emaill address has already been created.";
     else if (status == "deleteOk")
     message="Delete successful.";
     else
          message="";*/
//Get Contacts
     String name;
     String email;
     String extNo;
     String phoneNo;
     String remarks;
     String SQLstmt;
     SQLstmt = "Select * from CONTACT";
if (DbConnectBean1.connect()==true){
%>
<html>
<head>
<title>Display Contacts</title>
<script src="validation.js" language="Javascript"></script>
<script Language="JavaScript">
//Perform Validation
/* function checkForm() {
var alertString=checkChkBox(theForm.chkItem.value);
     formSubmit(alertString);
</script>
</head>
<body bgcolor="#ffffff">
<form action="USRDelContact.jsp" name="theForm" onsubmit="return checkForm();">
</form>
<table>
<tr>
<td><input type="chkAll" id="chkAll"onclick="checkAll(document.theForm.chkItem)"/></td>
<td>Name</td>
<td>Extension No.</td>
<td>Mobile Phone No.</td>
<td>Email Address</td>
<td>Remarks</td>
<td> </td>
</tr>
<%
     ResultSet r = DbConnectBean1.execSQL(SQLstmt);
     while (r.next()){
%>
<tr>
<td><input type="checkbox" name="chkItem" id="chkItem" value="<%= r.getString("Email")%>"/></td>
<td><%= r.getString("Emp_Name")%></td>
<td><%= r.getString("Ext_No")%></td>
<td><%= r.getString("Cellphone")%></td>
<td><a href="mailto:<%= r.getString(Email")%">"><%= r.getString("Email")%></a></td>
<td><%= r.getString("Remarks")%></td>
<td><a href="USREditContact.jsp?email=<%= r.getString("Email")%>">Edit</a></td>
</tr>
<%
if (r.next()==false)
%>
<tr>
<td colspan="7">There are no records currently.</td>
</tr>
<% }
}//end if%>
<tr colspan="6">
<td>
<%//=message%> <input type="submit" name="btnDelete" value="Delete">
</td>
</tr>
</table>
</form>
</body>
</html>
</a>

Similar Messages

  • Jsp and db2 problem

    Hi guys:
    I installed tomcat4, db2 run time client on one red hat 7.2. Everything works fine. My jsp can access db2 database.
    Now I am installing the same thing into another box, red hat 7.2, tomcat4 and db2 run time client.
    I can write a java code to access the db2 database, and I can access db2 table in the command line. Jsp file is running fine. But when I use the jsp code which is working in another red hat box to access the db2 database, it can not go through and it stops in "Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");" statement.
    Does any body have any idea what could be the problem?
    Regards,
    David

    hi,
    could you please send me the jsp-db2 connection code.i am really distressed.i can't find it anywhere..must i install db2 run client. i have only db2 personal edition and the rest( tomcat,jre,jsdk,etc..)
    Thx
    (while tipping my e-mail in registration,i wrote it false)
    My treu e-mail is [email protected]
    please please send me this code....

  • OWB and DB2 connection

    I have connected Oracle 9i and DB2 v7 and query DB2 in SQL Plus is fine. However, it doesn't for the connection between OWB and DB2.
    Anyone can help?
    Thanks!

    Try the following and use the database link as the source.
    1. Copy inithsodbc.ora to initQA_DB2.ora in $ORACLE_HOME\hs\admin
    HS_FDS_CONNECT_INFO=DNS_NAME_OF_YOUR_CONNECTION
    HS_FDS_TRACE_LEVEL=0
    2. Add the following lines to listener.ora in Oracle server ($ORACLE_HOME\NETWORK\ADMIN)
    (SID_DESC =
    (SID_NAME = QA_DB2)
    (ORACLE_HOME = $ORACLE_HOME)
    (PROGRAM = hsodbc)
    3. Add the following lines to tnsnames.ora in Oracle server ($ORACLE_HOME\NETWORK\ADMIN)
    DB= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)
    (HOST=localhost)
    (PORT=1521)
    (CONNECT_DATA = (SERVICE_NAME=QA_DB2)
    (HS = OK)
    4. Execute CATalog script for Heterogeneous Services in Oracle server ($ORACLE_HOME\RDBMS\ADMIN\caths.sql)
    5. Create database link
    drop public DATABASE LINK dwh_qa_db2;
    CREATE public DATABASE LINK dwh_qa_db2 CONNECT TO "carlosmo" IDENTIFIED BY "E1Qual" USING 'DB2';
    6. Test the connection
    SELECT *
    FROM SomeTable@dwh_qa_db2

  • JSP and MySql Connectivity in Fedora core 4

    Dear all,
    We are developing software using JSP and MySql on Fedora Core 4 platform and are unable to find the connectivity for JSP and MySql. Can anybody help....

    Dear all,
    We are developing software using JSP and MySql on Fedora Core 4 platform and are unable to find the connectivity for JSP and MySql. Can anybody help....

  • Developer 6i and DB2 connectivity.

    I am using Oracle8i with Developer 6i.
    I need to connect to DB2/400 (running under OS/400) from Forms Developer 6i
    i have IBM AS400 Client Access (version : 3, release : 2,
    modification level : 0 ) installed on this machine, which
    is working allright, i have checked it by using datatransfer from
    AS/400.
    the username on DB2 is ORACLE (password is same as username).
    i have created ODBC system data source (named SYSDB2) for OCA connection
    while i connect from sqlplus, it connects with some error messages as
    shown below, however it works allright for querying.
    SQL> CONN ORACLE/ORACLE@ODBC:SYSDB2 ;
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Server not available or version too low for this feature
    ORA-00022: invalid session id; access denied
    Connected.
    SQL>
    i have run PUPBLD.SQL but had no affect on these messages .
    When i try to create data dictionary views for DB2 from this connection
    by running script (Db4dmbld.sql) it does not create data dictionary.
    its fine till this happens, the real problem is that i am
    unable to connect to db2 by using odbc datasource from forms6i.
    when i try to connect it shows some special characters in a
    message box which can't provide any information.
    please let me know if there is any fix to this problem.
    regards,
    aamir.

    Hi,
    the site where you can find it is http://technet.oracle.com/doc/gateways.htm
    The gateway has no database functions. The gateway provides an interface by which the Oracle server can direct SQL operations to a DB2 database.
    Using a database link, the gateway is identified to the Oracle server. The database link is the same construct used to identify other Oracle server databases.
    Tables on the DB2 server are referenced in SQL as:
    table_name@dblink_name
    or
    owner.table_name@dblink_name
    If you create synonyms or views in the Oracle server database, you can refer to tables on the DB2 server using simple names as though the table is local to the Oracle server.
    When the Oracle server encounters a reference to a table on the DB2 server, the applicable portion of the SQL statement is sent to the gateway for processing. Any host variables associated with the SQL statement are bound to the gateway and, therefore, to the DB2 server.
    The gateway is responsible for sending these SQL statements to the DB2 server for execution and for fielding and returning responses. The responses are data or messages. Any conversions between Oracle datatypes and DB2 datatypes are performed by the gateway. The Oracle server and the application read and process only Oracle datatypes.
    --Samson
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Aamir Muhammad ([email protected]):
    Thanks Samson for you only reply on the
    topic, would you kindly tell me where can i find Oracle's Transaction Gateway for AS/400?
    Inspite all appreciation that i feel for you, What i think is that Gateways are used to establish connections between two databases not between a tool and a database like forms and AS400.<HR></BLOCKQUOTE>
    null

  • DreamWeaver CS5, PHP and DB2 Connections

    Hi,
    I have been playing around with a XAMPP server, a mySQL database and DW CS5. This all works great and DW is a great assistant compiling the necessary PHP code so I dont have to worry about all that.
    I do have a number of DB2 database I would like to attach to and there is nothing untuitive in DW allowing me to connect to DB2 databases. Has anyone seen any useful examples here
    All my Apache and DB2 server are running on Linux hence Windows samples will not be that useful to me.
    ThnX in advance for any hints.
    - Bjoern

    Hi,
    I have been playing around with a XAMPP server, a mySQL database and DW CS5. This all works great and DW is a great assistant compiling the necessary PHP code so I dont have to worry about all that.
    I do have a number of DB2 database I would like to attach to and there is nothing untuitive in DW allowing me to connect to DB2 databases. Has anyone seen any useful examples here
    All my Apache and DB2 server are running on Linux hence Windows samples will not be that useful to me.
    ThnX in advance for any hints.
    - Bjoern

  • JSP and Database connectivity

    Hello!
    I have Tomcat 4.0. and my database file is in Access (emp.mdb)
    I want to connect this Data file from JSP, for that any Driver I have to
    install? like JDBC driver...
    What is the steps and How do I connect? Pl. reply me.
    Thax,
    regards
    mohan

    Dear Amn,
    I am giving sample program. Just change the emp.mdb file path and run this jsp program.
    Then you can see the driver information etc.,
    if you get any problem, please call me at [email protected]. then i will give u solution assp.
    Thank you very much.
    all the best.
    Yours
    Rajesh
    <title>Database Test</title>
    <font face="verdana" size=2 color="blue">
    <%@page import="java.sql.*"%>
    <%
         Connection con=null;
         Statement st=null;
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/emp.mdb","","");
              st=con.createStatement();
              out.println("Connected To Database ");
              out.println("<BR><BR>");
              DatabaseMetaData md = con.getMetaData();
              out.println("Driver Name " + md.getDriverName());
              out.println("<BR><BR>");
              out.println("Driver Version " + md.getDriverVersion());
              out.println("<BR><BR>");
              out.println("Database URL is " + md.getURL());
              out.println("<BR><BR>");
              out.println("Database UserName is " + md.getUserName());
              out.println("<BR><BR>");
              out.println("Connection Name " + md.getConnection());
              out.println("<BR><BR>");
              out.println("Database Name " + md.getDatabaseProductName());
              out.println("<BR><BR>");
              out.println("Database Version " + md.getDatabaseProductVersion());
              out.println("<BR><BR>");
              out.println("Database ReadOnly Type " + md.isReadOnly());
              out.println("<BR><BR>");
              out.println("MaxColumnNameLength " + md.getMaxColumnNameLength());
              out.println("<BR><BR>");
              out.println("MaxConnections " + md.getMaxConnections());
              out.println("<BR><BR>");
              out.println("");
    catch(Exception e)
         out.println(e);
         finally
              try {
                   if(st != null) {
                        st.close();
                        st = null;
                   if(con != null) {
                        con.close();
                        con = null;
              } catch (SQLException e) {}
    %>

  • Jsp and database connection using bean

    * I want create a bean to handle database connectivity.The
              <jsp:usebean> tag uses
              no argument constructor ..so I cannot pass the userid and password to
              the constructor.
              So how can I create a database connection when the user_id and password
              will be a part of parameter ?
              * Now I'm opening database connection in the jsp scriplets. Everytime I
              refresh the
              jsp page a new connection is created ? Is it not going to choke the
              database ? I cannot use connection pool because every user logs in with
              different userid.
              Thanks
              

    You can pass your arguments in this way:
              <jsp:usebean id="myBean" scope="page"/>
              <jsp:setProperty name="myBean" property="userId", value=<%= user_id%>/>
              <jsp:setProperty name="myBean" property="password", value=<%=
              user_password%>/>
              of course, in your bean class, you should create two setter methods,
              setUserId and setPassword.
              Hopefully, this will help you.
              sonia WEN
              Chiranjib Misra wrote:
              > * I want create a bean to handle database connectivity.The
              > <jsp:usebean> tag uses
              > no argument constructor ..so I cannot pass the userid and password to
              > the constructor.
              > So how can I create a database connection when the user_id and password
              > will be a part of parameter ?
              >
              > * Now I'm opening database connection in the jsp scriplets. Everytime I
              > refresh the
              > jsp page a new connection is created ? Is it not going to choke the
              > database ? I cannot use connection pool because every user logs in with
              > different userid.
              >
              > Thanks
              

  • PleaseHelp on jsp and Mysql connectivity and a lot of exception errors

    Hi,
    I am Trying to connect a JSP page with Mysql database. I am having a lot of probelms. After having a lot of problems in connecting the JSp with Mysql. Intilally it was giving me the exception error that " NO appropriate driver was found. After modifying the URl it was fine. Now It is giving the Following errors.
    servlet.ServletException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream ** BEGIN NESTED EXCEPTION ** java.io.IOException MESSAGE: Unexpected end of input stream
    In a window before loading the Explorer page it is giving the following error that The port 8081 is already in use and i should expand to other ports. Noraml JSP Files which used to work before are also not working .
    Internal Tomcat JWSDP is alos not working. If i try to start the server it says that port 8081 is already in USe . A java.net.connection exception is also occuring. The normal JSP files are also not working. What is Happening. I am also giving the code i have writted. PLease tellme why so many exception errors are occuring.
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8081/mis_project", "root", " ");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("Select study_semester FROM Semester");
    while(rs.next()) {
    %>
    <option value="<%= rs.getString("Study_Semester") %>">
    </option>
    <% }
    if(rs!=null) rs.close();
    if(stmt!=null) stmt.close();
    if(con!=null) con.close();
    I am trying to connect to Mysql and automatocally populate a field in a Form in later JSp pages i intend to record the data entered in these fields into other tables.

    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/myDB?user=username&password=mypass");
    Statement stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
    String cat = "";
              try{
              cat = request.getParameter("category");
              }catch(NullPointerException npe){}
              ResultSet rs = stmt.executeQuery("SELECT id,fullname FROM users WHERE category LIKE '%motor%' AND subcategory like '%"+cat+"%'");
         %>
    This piece gets a category parameter from a form post and uses it to search for a specific category in a database table. I think maybe u need to download JConnector from mysql site and unzip it to the classes folder of your WEB-INF in Tomcat server...... i hope this helps a bit

  • Oracle 8i and DB2 Connectivity

    Hi,
    I dont know whether this is right forum to post this query.
    I want to connect to DB2 from Oracle 8i. I have read some documentation about Oracle gateways but it is not clear of how exactly we can connect to DB2.
    If any one has done this before please let me know th detail steps of how we can connect to DB2.

    You can use oracle product Interconnect. If you search on interconnect you will get your answer.

  • JSP and DB2

    I encountered this problem.... been searching around but cant find any help...
    I created the jsp page with a dropdown list with some values. so everytime the user select a particular value, the jsp page is supposed to retrieve from database some data and populate another dropdown list... so i wonder anybody can help.... urgently needed help

    Picked up something from a JS site that can be adapted.
    It allows dynamically filling a second (and third, fourth...) select control based on the value of another select.
    If you were to generate all the possible values for all boxes initially and store those in Javascript arrays (properly indexed of course) you can then fill the second box based on the value selected in the first.
    http://javascript.internet.com/forms/dropdown-box-population.html

  • CR2008, C# and DB2 - Connection Info

    I have a report, originally created in Crystal Reports ver 9, and I have loaded it successfully in CR 2008 (stand alone).  I am able to run that report just fine, it prompts me for the parameter needed for the report, then it promts me for an ODBC data source, which I select, and it runs as expected.
    BTW, this report was generated using a COMMAND to specify the necessary tables and fields for the report instead of selecting specific table and field names (since the list of tables is unavailable via the ODBC link)
    However, in my C# code, I cannot get it to run.  It would appear the information required in the ConnectionOnfo object isn't appropriate for an ODBC datasource, unless I'm over looking something.  So can somebody help me out with setting this up so it runs correctly?
            private void RunReport()
                ReportDocument oRpt = new ReportDocument();
                try
                    oRpt.Load(this._Settings.ReportDirectory + this._ReportFile);
                catch (Exception err)
                    Console.WriteLine(err.Message);
                    Console.ReadKey();
                ConnectionInfo connInfo = new ConnectionInfo();
                // the ODBC DSN on this system is GS30QA, but I'm not sure how to specify this via the ConnectionInfo
                // object... So instead I'll list the actual elements for the cnnection
                connInfo.DatabaseName = "GS2007";
                connInfo.UserID = "secret";
                connInfo.Password = "secret";
                connInfo.ServerName = "PHX-VM-GS30QA1";
                Tables oTables = oRpt.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table oTbl in oTables)
                    TableLogOnInfo tableLogonInfo = oTbl.LogOnInfo;
                    tableLogonInfo.ConnectionInfo = connInfo;
                    oTbl.ApplyLogOnInfo(tableLogonInfo);
                oRpt.SetParameterValue(0, 0);
                // this fails, with an error message of
                // {"Failed to open the connection.\rFailed to open the connection.\nUSPS_ItemizedManifest {DA872B86-5A97-4CF5-B099-2C866D933351}.rpt"}
                oRpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"C:\NET 2.0 Projects\Logicor.GSRouter.Reports\Logicor.GSRouter.Reports\Outputs\test1.pdf");

    Sorry to necro this post, but I was temporarily pulled off this specific project to handle somethig else that was considered a
    higher priority.  Now that I'm finished with that task, it's time to revisit this.  Unfortunately, there's been no progress.
    Also, so everything is clear... When I run this report in the Designer, and press F5 the report promts me to choose an ODBC DSN, and
    I choose this very same one and the report runs.  I just cannot get it to run via the code, it's unable to connect to the DB,
    although I don't know why since it's obvious the report runs in the designer just fine.
    I did as the last post said:
    // name of the 32 bit System DNS on this machine
    connInfo.ServerName = "GSDEMO";
    // name of the actual database
    connInfo.DatabaseName = "GS2007";
    connInfo.UserID = "secret";
    connInfo.Password = "secret";
    Tables oTables = oRpt.Database.Tables;
    foreach (CrystalDecisions.CrystalReports.Engine.Table oTbl in oTables)
        TableLogOnInfo tableLogonInfo = oTbl.LogOnInfo;
        tableLogonInfo.ConnectionInfo = connInfo;
        oTbl.ApplyLogOnInfo(tableLogonInfo);
        // this return false, but I expected that because it's never been able to connect.  I need to know why, which is what I've
        // never been able to discover.
        bool blConnected = oTbl.TestConnectivity();
        Console.WriteLine("Connected: " + blConnected.ToString());
    The error I get this time is
    Failed to open the connection.
    Details:  [Database Vendor Code: -1013 ]
    Failed to open the connection.
    USPS_ItemizedManifest_CR2008 {CD9615AE-3601-4E89-B49B-FB2D54726593}.rpt
    Details:  [Database Vendor Code: -1013 ]
    CrystalDecisions.CrystalReports.Engine.InternalException was unhandled
      Message="Failed to open the connection.\nDetails:  [Database Vendor Code: -1013 ]\rFailed to open the connection.\nUSPS_ItemizedManifest_CR2008 {CD9615AE-3601-4E89-B49B-FB2D54726593}.rpt\nDetails:  [Database Vendor Code: -1013 ]"
      Source="CrystalDecisions.ReportAppServer.DataSetConversion"
      StackTrace:
           at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
           at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
           at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
           at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
           at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
           at Logicor.GSRouter.Reports.MsgParser.RunReport() in C:\NET 2.0 Projects\Logicor.GSRouter.Reports\Logicor.GSRouter.Reports\MsgParser.cs:line 140
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.Runtime.InteropServices.COMException
           Message="Failed to open the connection.\nDetails:  [Database Vendor Code: -1013 ]\rFailed to open the connection.\nUSPS_ItemizedManifest_CR2008 {CD9615AE-3601-4E89-B49B-FB2D54726593}.rpt\nDetails:  [Database Vendor Code: -1013 ]"
           Source=""
           ErrorCode=-2147482892
           StackTrace:
                at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
                at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
           InnerException:

  • JDeveloper10g - JSP and Database connectivity sample please

    Please someone send me a sample JSP page develped in JDeveloper10g.<br> It should create a connection (like <database:dbOpen connId="conn1" user="scott" password="tiger" dataSourcee=??> )<br>
    Is dataSource="jdbc:oracle:thin:@121.100.110.7:1521:ORCL" allowed.<br>

    You can use this tutorial:
    http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25320/querdata.htm#sthref445
    However if you are looking for an easier way of doing these type of applications try one of the ADF tutorials.

  • Hi guys Pls tell me a way to connect db4 database with jsp and which driver

    hi guys
    Pls tell me a way to connect db4 database with jsp and
    also tell me which driver i have to use
    also tell me how to connect with excel sheets

    take a look at the follwing links. There, you'll find all what you need :
    DB4:
    http://www.oracle.com/database/berkeley-db/je/index.html
    http://www.oracle.com/technology/products/berkeley-db/je/index.html
    http://www.oracle.com/database/berkeley-db/db/index.html
    http://www.oracle.com/database/docs/berkeley-db-je-datasheet.pdf
    Excel:
    http://64.18.163.122/rgagnon/javadetails/java-0516.html
    Hope That Helps

  • Unable to connect JSP and MySQL

    Hi, I am new to this forum
    I've started developing web pages using JSP
    I've the problem connecting JSP and MySQL database. I've created the page that retrive records from mysql table. But the connection fail to access to database it gives me this error:
    org.apache.jasper.JasperException: Exception in JSP: /retreive_book.jsp:15
    The code is:
    12: <%
    13: //Class.forName("com.mysql.jdbc.Driver").newInstance();
    14: Class.forName("org.gjt.mm.mysql.Driver");
    15: connection = DriverManager.getConnection(connectionURL,"","");
    16: statement = connection.createStatement();
    17: rs = statement.executeQuery("SELECT * FROM books_detail");
    18: %>
    And the connectionURL parameter has this value:
    String connectionURL = "jdbc:mysql://localhost:3306/books?username=;password=";
    root cause msg is:
    java.sql.SQLException: Invalid authorization specification: Access denied for user 'nobody'@'localhost' (using password: NO)
    Please can anyone help me. It is 3 days now trying to do that but not succeded yet

    Hi
    Yes It is true that my MySQl installation its username is root. So how should put that in the url. Cause I did that but it didn.t work
    String connectionURL= "jdbc:mysql://localhost:3306/books?username=root;password=";
    If I write in that manner is it correct for root username or should I put a single quote
    Thanks

Maybe you are looking for

  • Last boy in the classroom

    Sony is the last company that didn't even enounce a JB for there devices. How pathetic. You guy's from sony deliver good hardware. But software support is really bad. (putting that in nice words ). And good software is just as important as good hardw

  • PSCS3 print output washed out

    I have a one page composite document with photos and text that I have been printing for years without problems. Now when I print the document the colors are washed out, grainy, almost like it's in draft mode. I can't seem to find what setting has cha

  • Need to control demand flow from APO system in the R/3

    HI Gurus, Kindly help me control the demand flow from APO system in the R/3. We want to change the timeline where demands coming from APO are given back to APW. The idea is to have a control table in APW where we can set a number of days or weeks by

  • Firefox shut down & updated in the middle of my work; I could not restore my session; you have literally cost me my job and future.

    Firefox shut down & updated in the middle of my work; I could not restore my session; you have literally cost me my job and future if this cannot be fixed. I don't understand why it updated without me prompting it to. It also never ask to report a cr

  • Audio Effects delay kicking in after each clip

    Hello, I am using DeNoiser and NewBlue Noise Reducer to eliminate some hiss I have on my audio. Though the effects work to improve the sound, it takes about 2 seconds for the effects to kick in, and this happens with each clip. In other words, the hi