JSP and MySQL

dear all,
I am new to sql and database programming and am a bit confussed about the line:
Connection Conn = DriverManager.getConnection("jdbc:mysql:dbname");
the jdbc is the what is the dbname??? is it the address of the database on your hard drive??? how is it formated??? what is the file that you need to point to??? how dies this work
Thanks T

Hi
the JDBC Url should have the following format
jdbc:mysql://<hostname>:<port>/<database>
If your MySQL Database is running at your local host
and it is using the default port than you can use
jdbc:mysql://127.0.0.1:3306/test
jdbc -> Means you are trying to open a jdbc connection
mysql -> MySQL Databse Driver
(make sure that your MySQL jdbc driver is registered)
to connect to the test database on your MySQL Server
regards
thsimon

Similar Messages

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

  • 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

  • Syntac error in JSP and MySQL

    HI guys,
    I have been facing another problem. The codings below. Worked well with my JSP and Access database.
    Then I transfered my database to MySQL and it gives out syntax error in my SQL statement.
    CODE1:
         sql = "SELECT Week, SUM (Total_Inspected) AS ins, SUM (Total_Rejected) AS rej, SUM (Total_Accepted) AS acc, SUM (DPPM) AS dpp, SUM (Yield) AS yeel FROM Calc_Data WHERE MONTH(Inspect_Date) ="+bulann+" GROUP BY Week";
         ResultSet rs = stm.executeQuery(sql);
    CODE2:
    String query   = "SELECT ID, Model, Lot_No, Lot_Qty, Inspected_By, Reject_Desc, Area_Concerned, Location, Remark FROM OQA WHERE Customer = '"+customer+"' AND Inspect_Date =#"+tarikh+"#";
    ResultSet rs   = stmt.executeQuery(query);

    Whenever you have this type of problem, the easiest
    solution is to take the sql and try running it
    directly. For MySQL, you can either use the
    command-line client, or there are a few graphical
    clients that can handle it. Just type in the query,
    run it, and let the database itself tell you what the
    error is.
    In any case, you probably won't find much useful
    advice on a JSP forum, esp. since the problem has
    absolutely nothing to do with JSP.Indeed - I agree with this. - MOD

  • Problems with JSP and MySql bean.

    Hi,
    I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
    the sqlhandler:
    public abstract class SqlInjektor {
         private static String Database = "*****";
         private static String serverName = "localhost:3306";
         private static String usrName="******";
         private static String passw="******";
         * @return Connection
         public static Connection createConnection(String error){
              Connection mySqlCon = null;
              try{
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
              catch(Exception E){
                   PrintWriter out = response.getWriter();
                   out.println("lol");
              String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
              try{
                   mySqlCon = DriverManager.getConnection(url);
              catch (Exception E){
                   E.printStackTrace(System.out);
              return mySqlCon;
         * Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
         * @param command
         * @return ResultSet
         public static ResultSet querySQL(String command,String error, Connection con){
              ResultSet rs = null;
              try{
                   Statement stmt = con.createStatement();
                   rs = stmt.executeQuery(command);
              catch(Exception E){
                   E.printStackTrace(System.out);
              return rs;
    the jsp page:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page isErrorPage="false" %>
    <%@ page import="java.sql.*" %>
    <%@page import="ot3.User"%>
    <%@page import="ot3.SqlInjektor"%>
    <%@page import="Javax.servlet.jsp.*"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>vastaanotto</title>
    </head>
    <body>
    <%!      String id;
         String password;
         String error = new String("Error!\n");
         User user;
    %>
    <%      user = new User();
         session.putValue("currentUser",user);
         id = request.getParameter("authName");
    password = request.getParameter("Password");
         Connection conn=null;
         ResultSet rs=null;
         conn = SqlInjektor.createConnection(error);
         if(conn!=null){
              out.println("conn ok!");
              rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
         try {
              if (rs!= null && rs.next()){
                   user.setID(rs.getInt("id"));
                   user.setName(rs.getString("name"));
                   user.setPassword(rs.getString("password"));
                   user.setClearance(rs.getInt("clearance"));
                   if(rs.getString("addedby")!=null)
                        user.setAdder(rs.getInt("addedby"));
                   if(rs.getString("lastmodifier")!=null)
                        user.setModifier(rs.getInt("lastmodifier"));
                   rs.close();%>
                   ONNISTU!
              <%}
              else {
                   out.println(error);     
         } catch (SQLException e) {
              out.println(e.getMessage());
         }%>
    </body>
    </html>

    Hi,
    I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
    the sqlhandler:
    public abstract class SqlInjektor {
         private static String Database = "*****";
         private static String serverName = "localhost:3306";
         private static String usrName="******";
         private static String passw="******";
         * @return Connection
         public static Connection createConnection(String error){
              Connection mySqlCon = null;
              try{
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
              catch(Exception E){
                   PrintWriter out = response.getWriter();
                   out.println("lol");
              String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
              try{
                   mySqlCon = DriverManager.getConnection(url);
              catch (Exception E){
                   E.printStackTrace(System.out);
              return mySqlCon;
         * Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
         * @param command
         * @return ResultSet
         public static ResultSet querySQL(String command,String error, Connection con){
              ResultSet rs = null;
              try{
                   Statement stmt = con.createStatement();
                   rs = stmt.executeQuery(command);
              catch(Exception E){
                   E.printStackTrace(System.out);
              return rs;
    the jsp page:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page isErrorPage="false" %>
    <%@ page import="java.sql.*" %>
    <%@page import="ot3.User"%>
    <%@page import="ot3.SqlInjektor"%>
    <%@page import="Javax.servlet.jsp.*"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>vastaanotto</title>
    </head>
    <body>
    <%!      String id;
         String password;
         String error = new String("Error!\n");
         User user;
    %>
    <%      user = new User();
         session.putValue("currentUser",user);
         id = request.getParameter("authName");
    password = request.getParameter("Password");
         Connection conn=null;
         ResultSet rs=null;
         conn = SqlInjektor.createConnection(error);
         if(conn!=null){
              out.println("conn ok!");
              rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
         try {
              if (rs!= null && rs.next()){
                   user.setID(rs.getInt("id"));
                   user.setName(rs.getString("name"));
                   user.setPassword(rs.getString("password"));
                   user.setClearance(rs.getInt("clearance"));
                   if(rs.getString("addedby")!=null)
                        user.setAdder(rs.getInt("addedby"));
                   if(rs.getString("lastmodifier")!=null)
                        user.setModifier(rs.getInt("lastmodifier"));
                   rs.close();%>
                   ONNISTU!
              <%}
              else {
                   out.println(error);     
         } catch (SQLException e) {
              out.println(e.getMessage());
         }%>
    </body>
    </html>

  • 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

  • About jsp and mysql

    Hi all,
    Requirement:
    I have a front end in which there are 3 fields name,age,status when ever I enter values these should be stored in mysql db.and here in status I have check constraint it should be either 'Active' or 'Inactive'
    when ever I enter Active into status text field It should store as 1 in db
    when ever I enter Inactive into status text field it should store as 0 in db .
    How to acheive this please give me some suggestions
    Thanks in Advance....

    Also, rather than submit the page on clicking the 'save' button, have an onClick() attribute added to the save button that calls a javascript function. In the javascript function, do some basic client side validation before allowing the function to submit to the server. Example: name cannot be empty, age cannot be empty, age must be a number (no letters), either active or inactive must be checked.

  • JSP and MySQL - Datetime

    Hi, I am pretty new using MySQL. I have doubt on the datetime field used in MySQL.
    Here is my issue. I have a datetime column, called CreatedDate.
    I store the strTodayDate in it.
    Date dtTodayDate = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String strTodayDate = sdf.format(dtTodayDate);
    But when I retrieve it and display on page, it gave me 2005-05-26 09:25:19.0 <--- extra dot & zero.
    Can someone please kindly advise me why?
    Thank you very much.

    When storing date time it does not realy store it in the same format you give it.
    and when you retrive the date time the my sql simply dont know in which format did you save it. So it will give it in a standerd format.
    When you store and retrive date/time value use java.sql.DateTime / Date / Time objects and always use methods like setDate and getDate. do not convert them to strings.
    I my applications I also used to store dates as long values (in millisecs) in column type BIGINT instead of actual date time column type. That way also you can overcome this problem since my sql will not treat the value as a date but as a long number.

  • JSP and MySQL timestamp

    hi all,
    we have a MySQL database containing a TAGLOG table and the following columns:
    TAGNUMBER, int
    TAGVALUE, float
    TAGTIMESTAMP, timestamp
    a Schneider Electric Factory Cast HMI Modicon PLC module keeps logging data from the PLC onto the TAGLOG table.
    we need to set-up a form to allow the user to select:
    start date: ____
    start time: ____
    end date: ___
    end time: ___
    so we can build a query, send to the database and when thre Result Set is received show on a table format.
    Any assistance in setting up a user friendly form to enter above dates and times will be appreciated.
    thanks in advance for any assistance.
    Trajano

    this is a problem i need to deal with soon, and am wondering the best way for it as well.
    the easiest (and quickest) would be a simple text box for each, where user types date and time as a string, with separators eg 13/03/1982 or 13:32
    Otherwise three drop-down lists, one for day, one for month & one for year. Similar for time.
    for me it's not worth creating or buying some fancy 'calendar' control, but i'm sure there are many available.

  • Jsp and mysql... best aproach

    hi all ! I need to do some checking of some data before submiting my form. So my idea is that depending on what you select in a list/ menu the values of another list changes. I know I could do this with javascript. The problem is that I want to make the values from the second list reflect data that is stored in a database.
    So how can I do this ?
    Any advice, recomendations, links are apreciated.

    Me, I would put an onChange event on the first select box that submits a form to retrieve the content of the second select box.
    There are ways to do it without a submit though:
    1) dynamic select box. It involves putting all possible values for the second select box into a huge javascript array and you use the first select box to index into this array.
    2) Ajax. With ajax you can fetch the data for the second select box in the background.
    3) hidden iframe. If you don't want to use ajax directly you could load a page in a hidden iframe that will mimic the ajax call.
    For all three options there are numerous articles on the web, just search for them.

  • Need a host free about jsp and mysql in order to test my subject project.

    Please show me a address host free . I need it to test my project. Thank so much

    Try Google Apps. Totally free.
    - Saish

  • An error when using JSP to activate connection between Javabean and MySQL

    I just input two paramenters in the input.htm, then click button 'submit' to
    run output.jsp, then activate adder.getSum(); This function is to add two
    number, save the sum to the MySQL database, and return the sum. I think the
    java code and jsp file are no problem. A guess it's the problem relating to
    the servlet engine trying to talk to the Javabean. Should I set some
    envirenment or other? Please take a look. If necessary, I will attach my jsp
    and java codes later.
    The error is as below:
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error)
    that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException:
    at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:273)
    root cause org.apache.jasper.JasperException:
    at org.apache.jasper.runtime.JspRuntimeLibrary.convert(JspRuntimeLibrary.java:184)
    I just selected some. Thanks,

    Yes, I'd be curious to see your code. In principle that should work.
    -chicagoJava

  • Examination system using JSP/SErvlet and MySQL

    Hi
    I am new to JSP /servlet.
    I am designing online examination system using JSP/Servlet and MySQL ,where multiple choice questions would be selected randomly from the database. After completion of the examination user gets the results ,also the results would be stored in the database for the future reference.
    Can anyone guide me for this? If possible give me the code for similar type of application.
    Thanks

    Sounds like you want someone else to do your homework for you, did you not read this:
    "This forum works so much better when you try to program the code yourself, then let us know where it doesn't work. Otherwise you learn very little, and we work a whole lot."
    and this
    "If you want free code, have you tried searching Google for it? You may want to consider looking for survey software. It will give you the question/answer capabilities then all you have to do is find a way to grade the survey (if you will)...
    If you are using Tomcat as your server, which you probably are, there is a jdbc tutorial included in the documentation, that is the fastest way to set up your database.
    As for your random selection, have a look at Math.random(), this is one way to generate random numbers, you will need an algorithm to convert this value (between 0.0 and 1.0) into a form that can be used to select information from your database.

  • JSP with MYSQL on linux and windows2k

    I am using a linux box as a web server with tomcat and mysql. I aslo have a mirror on a Win2k machine running the same environment.
    I have a jsp file that uses a bean to update the database and it works on the win2k environment but not linux.
    In windows I see error messages in the tomcat console, how do I see these message on linux?
    Thank you,
    Paul.

    Did you check ALL of the files?
    There are files named "localhost_log.TODAYSDATE.txt", there are files named "catalina_log.TODAYSDATE.txt", and there's a file called "catalina.out".
    "catalina.out" appears to contain information very similar to the DOS output screen on the Windows platform.
    If those files don't have what you're looking for, then you'll have to get help from someone with more expertise than myself!

  • JSP and Java Beans with Database Problem

    hellow, this is my first posting and i hope to help me as fast as you can...
    my problem is simplly i cant get any data from the database (whatever the database it is, i test it with MS Access and MySQL server) when i use a bean, But if i put my connection statement in the JSP file thair is no problem... ???? !!!!
    for example i have a class "Authentication" that have a method to test if the username and password is correct or not and return 1 if true, 0 if false, -1 if thair are some problem in connecting DB.
    now if i create a normal java application that uses this method, it's work and no problems, BUT if i used a JSP page to use this method it's return allways -1

    T1 class:
    package VX;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    public class T1
    //public MBJDBConnection(String driver,String url)
    public T1()
    JDBC_DRIVER = "com.mysql.jdbc.Driver";//driver;
    DATABASE_URL = "jdbc:mysql://localhost:3306/rawafed?user=root;password=0000";//url;
    //=======DB CONNECTION===========================================
    private static String JDBC_DRIVER;
    private static String DATABASE_URL;
    protected Connection connection;
    protected Statement statement;
    //===========End DBC==============================================
    public int update(String sqlUpdate)
         int i=0;
              //connectDB();
              try{
                   i=statement.executeUpdate(""+sqlUpdate);
                   catch(Exception e)
                        System.out.println("Error Inserting Statement Or Connection Not Opened");
              //disconnectDB();
         return i;
    public ResultSet select(String sqlQuery)
              //connectDB();
              ResultSet rs;
              try
              {//open try
              rs=statement.executeQuery(""+sqlQuery);
                   return rs;
              }//end try
              catch(Exception e2)
                   //System.out.println("Error Selecting Statement Or Connection Not Opened");
              }//end catch
              //add to array list
         //return resultList;
         return null;
    //------Methods-------
    public void connectDB()
    //===========================Connection===================
    try
    Class.forName(JDBC_DRIVER);
    catch(Exception e)
    System.out.println("Error : FOR NAME");
    try
    connection = DriverManager.getConnection(DATABASE_URL, "root", "0000");
    catch(Exception e)
    System.out.println("Error : DB URL");
    try
    statement = connection.createStatement();
    catch(Exception e)
    System.out.println("Error : CREATE STATEMENT ERROR");
    public void disconnectDB()
    try
    statement.close();
    connection.close();
    catch(Exception e2)
    System.out.println("Error : CAN'T CLOSE DB");
    T2 Class
    package VX;
    // class Person.
    //Required Class : EDC.EDCDB
    import java.sql.*;
    public class T2
         public T2()
              //initialization
         //........................ Attributes .........................
         private String user;
         private String password;
         private T1 db=new T1();
         private ResultSet rs;
         //......................... Methods .........................
         public String getAdmin(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success and he is a regular employee 3: SUCCESS AND HE IS agent
              try
              user=u;
              password=p;
              rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=1");
              if(rs.next())
                   return ""+1;
              else
                   rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=2");
                   if(rs.next())
                        return ""+2;
                   else
                        rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=3");
                        if(rs.next())
                             return ""+3;
                        else return ""+0;
              catch(Exception e){System.out.println("Error \n"+e.getMessage());return ""+e.getMessage()+"\n"+(-1);}
         public int getCard(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success
              user=u;
              password=p;
              try
              db.connectDB();
              rs=db.select("SELECT Card_ID,password FROM Card WHERE Card_ID='"+user+"' AND password='"+password+"'");
              if(rs.next())
                   return 1;
              return 0;
              catch(Exception w)
                   return -1;
              finally
                   //System.out.println("Done");
                   db.disconnectDB();
         public int getAny()
              return 1;
    }//end class
    This is a tested class and it's work OK
    import VX.T2;
    public class T3
         public static void main(String [] args)
              System.out.println("System Started...");
              try
                   T2 t2=new T2();
                   System.out.println(t2.getCard("1","a"));
              catch(Exception e)
                   System.out.println("Opsssss ...");
    Now this is the JSP Code that OK and Run without any problems
    <%@ page contentType="text/html; charset=windows-1256" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
    <title>test</title>
    </head>
    <body>
    <%
    //Mazin B. Jabarin 20210464
    //Testing JSP - MySQL Server Driver
    String connectionURL = "jdbc:mysql://localhost:3306/EDCDB?user=root;password=0000";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try{
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL, "root", "0000");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM a");
    while (rs.next()) {
    out.println(rs.getString("id")+"<br>");
    rs.close();
    catch(Exception e)
    out.print("Error : "+e.getMessage());
    %>
    </body>
    </html>
    Now this JSP File always returns (-1) ???? !!!!!!!
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" import="VX.T2" import="java.util.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    try
    T2 t2=new T2();
    out.println("Result Still : "+t2.getCard("1","a"));
    catch(Exception w)
    out.println("<BR> Error In Execution ??? "+w.getMessage());
    %>
    </body>
    </html>
    ++++++++++++++++++++++++++++
    any one can help me please :(
    i use tomcat as web-application
    and i install jdk 1.5
    also JBulder 7
    (now i supposed that the JBulder make some conflict, so i uninstalled it but still Not Working) ...
    before one year i was working just like this way and it was working
    but now i dont know what is the problem
    i am really need help.

Maybe you are looking for

  • Creating link to other Portlet's Header links

    I would like to have a link, in a HTML Portlet or someplace, to the 'Customize' or delete ('x') on a portlet's header. This way the user can click my link directly instead of searching for the portlet and clicking the Customize link there. I can do i

  • How do I turn off automatic stroke on text ?

    Using CS6 Am unable to colour any text without that colour selection being applied as a stroke Have clicked the "formatting affects " T button on the swatch panel and on tools panel. Have looked in styles and turned off  all stroke instructions that

  • How to Mapping with AP to GL Reconciliation Process

    Hi All We are using Oracle R 12. I have to Reconcile with Ap to GL. When i Reconcile with AP to GL (AP Trial Balance = GL Trial Balance ) should nock off but Closing Balance is Not Matching, Its showing some differance in morethan GL TB Closing Balan

  • New Server: How do we aim ALL users email accounts to use the new addresses

    We have a new server which we are using for mail (incl. smtp), we need to be able to make it so when a user logs in and loads mail (just like they would have done before) it finds their new email account as seamlessly as possible. In a windows enviro

  • Oracle UCM - Workflow Step Release on a specific Date

    I would like one of my workflow steps not to advance untill a specified date/time is meet. For example, a metadate field is set to "1/30/12 5:00" and the document enters workflow. In order for the document to advanced past this step, the date (1/30/1