How  to connect .... MYSQL database via JSP

Hello,
I am not able to connect mysql database via JSP... everytime i try to connect the database i get the following error .....
"java.lang.NoClassDefFoundError: org/aspectj/lang/Signature" ..
my jsp code is ....
<%@ page import = "java.sql.*" %>
<%
Connection conn = null;
Statement smt = null;
ResultSet rs = null;
%>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","username" ,"password");
smt = conn.createStatement();
rs = smt.executeQuery("select * from table");
out.println("output is "+ rs.getString("my field"));
rs.close();
%>
I have installed ............
jdk1.5.0_02
MySQL Server 4.1
there are two jar files .. i tried with both jar files ..
mysql-connector-java-3.1.8-bin.jar
mysql-connector-java-3.1.8-bin-g.jar
tomcat server 5.5.9
my path .... is
C:\Program Files\Java\jdk1.5.0_02\bin;C:\jakarta-tomcat-5.5.9\bin;C:\program files\mysql\mysql server 4.1\bin;
any help on this error ..at the earliest ..
... am worried ..bcoz my deadlines is getting closer .....
.. step by step .. procedure .. could be helpful ..
anil

Find out the JAR which contains the class and add it
to WEB-INF/classes directory for your web application.WEB-INF/classes directory ..means ..C:\jakarta-tomcat-5.5.9\common\classes .. is that the one i need to keep my jar files ....???????????
well i have downloaded .. mysql database connector from the website "http://www.mysql.com/products/connector/j/ " .. and i have downloaded MySQL Connector/J 3.1..under which i have downloaded "Source and Binaries (zip)" ..
anil

Similar Messages

  • How to connect MySql database with JSP

    Dear everyone,
    how to connect MySql database with JSP......

    It's too bad that nobody has ever asked this question before...

  • How to connect mysql database using xml

    welcome to all,
    here my doubt is how to connect mysql database using xml file, how to integrate xml file and jsp file and how to access data from dabase using jsp file. can any one help me
    regards

    Short answer: you wouldn't do any of those things. The first two are meaningless and the third is a bad practice. I have no idea what those ideas were supposed to achieve so I have no idea what tutorials I should suggest to you.

  • How to connect mySQL database with jdbc

    Who can tell me how to connect mySQL database with jdbc? Thanks

    http://onesearch.sun.com/search/developers/index.jsp?and=connect+mysql&nh=10&phr=&qt=&not=&field=title&since=&col=devforums&rf=0&Search.x=24&Search.y=16

  • How to Connect MySQL Database Through JTable?

    Hi,
    How to Connect MySQL Database Through JTable? anyone of u knows these concept please send me coding of that Part..
    Thanks,
    Guru..

    Start by reading the tutorials. There's a section on Swing which shows you how to use tables and a section on JDBC which shows you how to use SQL.
    And you can always search the forum as well since there are working examples of both posted on the forum.
    If you need further help with a specific problem then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.

  • How to connect to database in JSP

    Hi, all.
    I am using J2EE and cloudscape. I have written all the EJB classes. But now i have no idea that how to connect to database in jsp such as i get user ID from portal, then i connect to database check the existence of user ID and the password then return true or false value. how to write all this in jsp?
    Thanks very much!
    yayun

    this is the required code
    i hope this will help u
    <html>
    <head>
    </head>
    <body>
    <%@ page import="java.sql.*" %>
    <%
    try
    String fu=request.getParameter("username");
    String fp=request.getParameter("password");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection Con=DriverManager.getConnection("jdbc:odbc:wind","","");
    Statement stmt=Con.createStatement();
    ResultSet rs=stmt.executeQuery("select * from table1 where username='"+fu+"' and password='"+fp+"'");
    if(rs.next())
    %>
    <jsp:forward page="success.jsp"/>
    <%
    else{
    %>
    <jsp:forward page="unsuccess.jsp"/>
    <%
    catch(Exception e)
    %>
    </body>
    </html>

  • How to connected mysql database to iphone app?

    I make application which must use mysql database because my application is related to other desktop application

    If the app uses the same db as on the user's computer, you should look into using iCloud to share and sync the data. Visit the iOS Dev Center for details.

  • How to connect mysql database to labview and plot the graph

    Hi all,
     I am doing my final year project about labview. I need to connect my mysql workbench database to labview and plotting two sinwave in same graph. I can already connected my labview to mysql and showing the data in labview table.But I need to plot the two sinwave in on graph according to table data. Eg: table data&colon;      timestamp   wind speed  wind direction
                                                      ​                                                  ​                                                  ​                                            2004-01-01         0.5                 56
                                                      ​                                                  ​                                                  ​                                            2004-01-01         0.6                 60
      The attachemtn vi is about inserting file and plot the graph. And now I  want plotting the sinwave using table data and the  wind speed Y-axis,wind direction Y-axis in both side of my graph and the X-axis is showing the whole day timing like 00:00:00-24:00:00.  Can anybody combine these 2 vi to polting the graph according table data not according to file data.Thanks
    Attachments:
    Mysql.vi ‏11 KB
    Insert File.vi ‏25 KB
    Wind Project.vi ‏24 KB

    Please don't start a new thread. Stick to the original.
    http://forums.ni.com/t5/LabVIEW/How-to-plot-wavefo​rm-or-graph-using-table-database-which/td-p/294036​...

  • How to ping mysql database in JSP

    Hi guys,
    I am working on a JSP based application that sends data over to a remote mysql databse over port 5656 . I am intrested in writing a code sequence in JSP that will first check whether the remote mysql databse is working or not. If not, Then the user will be alerted.
    Any help in this matter will be deeply appreciated. I have searched a lot and could not get any pointers on this topic
    I am using tomcat 5.5 , latest j connector and mysql 5.0(latest)

    What you can do is execute a dummy statement, such as:
    select count(my_column) from my_table
    public boolean isDatabaseOK()
      try
        Connection c = MyDoConnection( blah );
        Statement s = c.createStatement();
        // make sure the table you chose below will ALWAYS have data in it!
        ResultSet r = s.executeQuery("select count(mycolum) from mytable");
        if ( r.next() ) return true;  // this makes sure the statement successfully completed
        else return false;
      } catch ( Exception e ) { return false; }
    }HTH

  • How to connect cloudscape database to jsp

    could someone help

    sorry im using ibm websphere and creating a dynamic web project that displays the contents of my cloudscape database when the JSP is ran on the websphere test server...no idea what im doin...if anyone has any help at all i would appreciate it quite a bit

  • 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

  • Cannot connect to database via TNS

    Hello!
    I installed XE with default settings and have some trouble. I cannot connect to database via TNS. Two symptoms:
    1. I can connect with SQLPLUS system/pwd (locally, without tns name input), but CANNOT connect with SQLPLUS system/pwd@EX (WITH TNS NAME input).
    2. I cannot start Database Home Page.
    How to avoid this problem? Any ideas?
    DETAILS:
    PC configuration: Win2k+SP4, 512Mb, Outpost Firewall (disabled!), No another Oracle products being installed.
    TNSNAMES.ORA file:
    ************* BEGIN TNSNAMES *****************************************
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = pz)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    ************* END OF TNSNAMES *****************************************
    Listener status:
    ************* BEGIN STATUS *****************************************
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Prod
    ction
    Start Date 22-MAR-2006 17:27:15
    Uptime 0 days 1 hr. 8 min. 53 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File D:\oracle\ora10xe\app\oracle\product\10.2.0\server\ne
    work\admin\listener.ora
    Listener Log File D:\oracle\ora10xe\app\oracle\product\10.2.0\server\ne
    work\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pz)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=8080))(Presentation
    HTTP)(Session=RAW))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "XEXDB" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "XE_XPT" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "xe" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    The command completed successfully
    ************* END OF STATUS *****************************************
    NETSTAT -an results:
    ************* BEGIN NETSTAT *****************************************
    Proto Local Address Foreign Address State
    TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:2298 0.0.0.0:0 LISTENING
    TCP 127.0.0.1:2455 127.0.0.1:8080 ESTABLISHED
    TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING
    TCP 127.0.0.1:8080 127.0.0.1:2382 CLOSE_WAIT
    TCP 127.0.0.1:8080 127.0.0.1:2455 ESTABLISHED
    TCP 192.168.200.49:1521 192.168.200.49:2298 ESTABLISHED
    TCP 192.168.200.49:2298 192.168.200.49:1521 ESTABLISHED
    <truncated>
    ************* END OF NETSTAT *****************************************
    I found following error in SQLNET.LOG:
    *************** START LOG *********************************************
    Fatal NI connect error 12570, connecting to:
    (LOCAL=NO)
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
         Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 10.2.0.1.0 - Production
         Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 10.2.0.1.0 - Production
    Time: 22-MAR-2006 17:28:59
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12570
    TNS-12570: TNS:packet reader failure
    ns secondary err code: 12560
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
    *************** END OF LOG *******************************************

    I successfully connect with XE client to another Oracle databases from LAN, including 8i and 9i databases.
    But cannot connect from another machines to my XE.

  • Accessing MySql database in jsp

    hi everyone!!!
    i m new to java with little knowledge of jsp.
    i want to access mysql database in jsp to develop a web page.
    i have jdk and mysql installed and these are working. what are other requirements and how to do this.
    plz help.
    OS: MS Windows XP/ Fedora 10

    Learn JDBC API: [http://java.sun.com/docs/books/tutorial/jdbc/index.html]. Create a DAO class which uses JDBC to interact with Java and takes or returns the desired data in form of DTO's. Use and test it as a plain vanilla Java application with a main() method. This require a JDBC driver (a concrete implementation of the JDBC API) in the classpath. MySQL offers JDBC drivers as download at their homepage, it is called "Connector/J".
    Once you got the JDBC part to work, create a Servlet class which holds an instance of the DAO class and uses its methods to interact with the database. In the doGet() you can place logic to preload data from the DAO class for display. In the doPost() you can place logic to process data for create, update or delete using the DAO class. Finally let it forward the request to a JSP.
    In the JSP you can use JSTL/EL to display data. For tabular view you may find the JSTL c:forEach useful. For plain display, just use EL the usual way.

  • How to connect oracle database into VC?GIve step by step.

    Hi Experts,
    Please help
    How to connect oracle database into VC?
    I need step by step.
    what shall i do the first to connect via jdbc or  something else.
    whether we have to create dsn name or using jdbc connections?which one to use?
    Please give the basic steps.Its very urgent.
    Thanks and Regards,
    Nutan

    Hi ,
    all information are in the following document:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424">How to Configure a Business Intelligence JDBC System for Visual Composer</a>
    Rgds,
    Karim

  • How to connect access database through oracle sql prompt

    i want to connect access database via oracle , i am trying to import all the data in Access table into oracle table how it is possible .
    A.R

    The simplest way, if You have already created tables in Oracle DB, is to open the Access MDB, link Oracle tables via ODBC and build a query to append rows reading from Access tables to Oracle tables.
    Hope this helps
    Max

Maybe you are looking for