Jsp jdbc connectivity problem.

i'm getting the following error
"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: /create_user.jsp(2,4) Invalid directive
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:527)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1568)
org.apache.jasper.compiler.Parser.parse(Parser.java:132)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)"
for the jsp file is :
<%@ page import="java.sql.*" %>
<%@ //page errorPage="exceptionHandler.jsp"%>
<%
String connectionURL = "jdbc:mysql://localhost:3306/decipher?user=localhost;password=passwd";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>
<html><body>
<%
String nr="nr";
String a= request.getParameter("emp_id");
String b= request.getParameter("name");
String c= request.getParameter("department");
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root", "passwd");
statement = connection.createStatement();
statement.executeUpdate("use decipher");
statement.executeUpdate("Insert into candidate_details values ('" +a+ "','" +b+ "','" +c+ "')");
%>
sucesssfully created New Account
</body>
</html>"

bmahesh7feb wrote:
org.apache.jasper.JasperException: /create_user.jsp(2,4) Invalid directiveAt line 2, character 4 of create_user.jsp there's an invalid directive. This is a plain code syntax error.
<%@ //page errorPage="exceptionHandler.jsp"%>What are those slashes doing there? Do you think that those Java style comments outcomments the JSP line? It is JSP code, it is not Java code. Remove the whole line or use JSP comments.
As for the remnant of your JSP code, there are a lot of flaws in there. First step to in the right direction would be to stop using scriptlets in JSP. Good luck.

Similar Messages

  • MSSQLServer jdbc connect problem on ODI 11G R2

    I have a MS SQL Server jdbc connect problem on ODI 11G R2 / Windows server 2008 64 bits.
    Tried, one by one, all versions of Microsoft drivers.
    Sqljdbc4.jar copied to : %appdata%\odi\oracledi\userlib\
    The Topology connect syntax is :
    driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    URL : jdbc:sqlserver://<host>:1433
    => All the topology tests end with time-outs.
    Installed 10G ODI.
    Works with 1.4 java and sqljdbc.jar version 2 jdbc driver.
    Times out with version 3 and/or Sqljdbc4.jar + JAVA_HOME & ODI_JAVA_HOME set to 1.6 path.
    also tried, with no success (time-outs) on either 10g or 11g :
    com.inet.tds.TdsDriver
    jdbc:inetdae7://<host>:1433?database=<DB>
    same results for :
    net.sourceforge.jtds.jdbc.Driver
    jdbc:jtds:sqlserver://<host>:1433
    Any suggestions for a fix?
    Many thanks in advance.

    Hello,
    ODI (11g) Studio is certified on Windows 32 bit only, not on 64bit.
    However you may still install it and configure ODI Studio to run with a 32 bit java.
    Details pls see Master Note For ODI 11g Install Issues And Questions (Doc ID 1214428.1).
    To connect to SQL Server:
    # Check and make sure the authentication mode of your Microsoft SQL Server Server is set to "SQL Server and Windows" or "Mixed", otherwise Oracle Data Integrator (ODI) is unable to connect to the database.
    # Before you create the Oracle Data Integrator (ODI) Dataserver in Topology Manager > Physical Architecture, stop all ODI processes, and place the JDBC Driver file in the ODI's userlib and "/drivers" folder.
    For ODI Studio (Local No Agent)
    %APPDATA%\odi\oracledi\userlib
    %APPDATA% is the Windows Application Data directory for the user (usually C:\Documents and Settings\<user>\Application Data).
    Standalone Agent
    ODI_HOME\oracledi\agent\drivers
    Note: If you decide to use the DataDirect driver that comes with ODI 11g install/ embedded in ODI 11g
    weblogic.jdbc.sqlserver.SQLServerDriver
    Then you don't need to worry about this step.
    # Make sure that the database is the default database of the user account employed by ODI for connection, and that the password is correct.
    # Verify (in your Microsoft SQL Server Server network configuration) that TCP/IP has been enabled on port 1433.
    For more details see How To Set Up JDBC Driver Connections For The Microsoft SQL Server For ODI (Doc ID 423914.1)
    If you try sqljdbc.jar, you need to configure ODI_JAVA_HOME to jdk1.5
    sqljdbc4.jar, jdk1.6 (since ODI 11g requires jdk1.6, I'd suggest sqljdbc4.jar)
    More see Compatibility Matrix For Java Machines And JDBC Drivers Used With ODI (Doc ID 807235.1)
    Hope that helps other people who run into this,
    Edited by: user742480 on Apr 4, 2011 12:06 PM

  • STRUTS - JDBC connection problem

    im using tomcat 5.5.9, jdk 1.5, oracle database...
    � have a project in struts...
    my project works with my compiler with no problem...
    *i setup tomcat on C:\jakarta-tomcat-5.5.9
    and � made these setting for tomcat:
    � added these strings to my CLASSPATH
    --C:\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar
    --C:\jakarta-tomcat-5.5.9\common\lib\jsp-api.jar
    after � deployed my project under tomcat there was a "classes12.zip" file under this path:
    C:\jakarta-tomcat-5.5.9\webapps\BILGISU\WEB-INF\lib
    � changed it to class.jar
    also � have other .jars under the same path above.
    these jars are:
    classes12.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-dbcp.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-lang.jar
    commons-logging.jar
    commons-pool.jar
    commons-validator.jar
    jakarta-oro.jar
    jdbc2_0-stdext.jar
    struts.jar
    struts-legacy.jar
    THE PROBLEM IS:
    my index page is a "login" page..
    i can open the login page under tomcat.
    but when � enter the username and password, page says it is wrong username or password although these are true parameters...
    i think i still have a connection problem but � dont know how to solve...
    MY SEARCHES SAYS:
    you have to reconfigure "C:\jakarta-tomcat-5.5.9\conf\server.xml" like that:
    <Resource name="jdbc/myoracle"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:[email protected]:1521:mysid"
    username="scott"
    password="tiger"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"/>
    Resource name="jdbc/myoracle" ->HERE WHAT IS "myoracle"??? DOES IT BELONG TO MY PROJECT?
    you have to reconfigure "C:\jakarta-tomcat-5.5.9\conf\web.xml" like that:
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    will i write this to my web.xml
    and what is "auth=Container" here???????
    thanks in advance
    yasin

    ONE MORE QUESTION
    Im defining the datasource in my "struts-config.xml"
    do i have to define them again in "tomcat/conf/server.xml" ...

  • App Server 8.1 JDBC Connection problem

    Dear Expert,
    Cu are using Sun Java System Application Server Enterprise Edition 8.1. Cu created one jdbc connection pool and datasource. They are called
    jdbc/RM
    From the App Server Admin Console -> Connection Pool, cu can "Ping" the database via the connection pool.
    Cu did the configuration on web.xml and sun-web.xml
    web.xml
    <resource-ref>
    <description>Oracle Database Connection - Rawmart</description>
    <res-ref-name>jdbc/RM</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    sun-web.xml
    <resource-ref>
    <res-ref-name>jdbc/RM</res-ref-name>
    <jndi-name>jdbc/RM</jndi-name>
    </resource-ref>
    In customer class,
    220: protected void initDataSource() throws NamingException {
    221: initContext = new InitialContext();
    222: envContext = (Context) initContext.lookup("java:comp/env");
    223: String dataSource = rConfigObject.getConfigValue("DATASOURCE");
    224: rDataSource = (DataSource) envContext.lookup(dataSource);
    225: }Exception occurs on line no. 222 already.
    From server.log, we get
    ================
    #|2005-06-03T11:36:11.562+0800|WARNING|sun-appserver-ee8.1|javax.enterprise.system.stream.err|_ThreadID=10;|
    javax.naming.NameNotFoundException: No object bound for java:comp/env [Root exception is java.lang.NullPointerException]
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:161)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.ns.DBObject.initDataSource(DBObject.java:222)
    at com.ns.DBObject.connectPool(DBObject.java:213)
    at com.ns.DBObject.<init>(DBObject.java:91)
    at com.ns.DBObject.getInstance(DBObject.java:122)
    at com.ncharter.NCContextListener.contextInitialized(NCContextListener.java:28)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4010)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4525)
    ===============
    Do you have any ideas on this problem? Thanks.
    Regards,
    Angus

    Try asking the Customer to fire up the JNDI browser in the admin console and try to browse the JNDI tree.
    What class is the InitialContext.lookup() happening in? Is that getting executed in the servlet class or a standalone client?
    thanks.

  • Test JDBC connection problem

    Hi all,
    I got a very weird problem when I click Test Connection Button.
    I installed xml publisher Enterprise 5.6.2 in the server, I attempt to configure Jdbc connection in this server. once I click the Test Connection Button after I input all information, all information will be cleaned in this server, i can not get any message if the connection works well.But if i use url like http://serverIP:15101/xmlpserver/ to login xml publisher on other machine, I will get successful or error message.
    who has same experience in JDBC configuration?how to solve it ,thanks in advance.

    Apologies ... not really sure what the issue is. I assume you are talking about setting up the JDBC connection for a data source?
    In that case the entries would be something like:
    connection string: jdbc:oracle:thin:@host.company.com:1525:ora10g
    un: oe
    pw oe
    driver class: oracle.jdbc.driver.OracleDriver

  • Filemaker JDBC connection problem

    I wonder if anyone with a lot of initiative and intelligence can help me with a connection problem.
    An ordinary copy of the Filemaker Pro database only accepts local JDBC connections - i.e. from the same machine.
    That's Ok because I also have a very expensive Filemaker Server license and Filemaker Server accepts connections from anywhere.
    However this causes me rather boring testing problems. My portable computer, where I write all my code, is a dual-boot machine (Windows and Linux), and for testing purposes I want to use an ordinary copy of Filemaker Pro on the Windows part, and throw queries at it from the Linux part. With the old version of Filemaker Pro, this was possible, with the new version, it is not (only connections from the same machine are accepted).
    Question: is there any way of writing a programme in the middle, hosted on the Windows part, that accepts connections from the Linux part, and then passes them on to the Filemaker Pro copy - which will then think that the query came from the local machine - and will then take the answer and relay it to the Linux part?
    Any help gratefully received.

    Question: is there any way of writing a programme in
    the middle, hosted on the Windows part, that accepts
    connections from the Linux part, and then passes them
    on to the Filemaker Pro copy - which will then think
    that the query came from the local machine - and
    will then take the answer and relay it to the Linux
    part?Just a small question. To my understanding dual boot means at a given time your computer will be running only one OS (either windows or linux) right?. Or are you running a VM with linux inside your windows?

  • JSP Mysql Connection Problem

    Hi Friend,
    I am facing some problem in connecting mysql with jsp .
    When I try and connect to mysql with the following connection string
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testdhiraj?user=root&password=dh");
    Statement statement     = con.createStatement();
    I get an error :
    java.sql.SQLException: Communication link failure: Bad handshake
    I don't know what is wrong,
    as I had tested mysql using telnet and it connects and executes sql nicely.
    Waiting for ur reply,
    Dhiraj Agrawal
    mail to : [email protected]

    Hi,
    You need to make sure that , you have given correct database name, user id and password in the connection url. and also check the jdbc driver is loaded properly. If your mysql is running in the standard port, you need not give the port as 3306.
    Here is the example :
    import java.sql.*;
         Notice, do not import org.gjt.mm.mysql.*
    or you will have problems!
    public class XampleClass
    public static void main(String[] Args)
    try {      
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    catch (Exception e) {
    System.err.println("exception while loading
    driver.");
    e.printStackTrace();
    try {
    Connection C = DriverManager.getConnection(
    "jdbc:mysql://localhost/test?user=myuser&password=mypwddb");
    // Do something with the Connection
    catch (SQLException e) {
    System.out.println("Exception: " + e);
    This is the format for conenction url :
    jdbc:mysql://[hostname][:port]/dbname[?param1=value1][&param2=value2]...
    Hope this helps you.
    Thanks,
    Senthil_Slash

  • Jsp-database connectivity problem

    hi
    There is a problem, when ever i write a jdbc code for database connectivity through MsAcess, in general applications it works fine. But when ever i try to the same using Jsps it throws an exception that " Microsoft jdbc-odbc driver not fount, Default driver not specified"
    please do help regarding this
    the code i used is
    package Products; import java.sql.*;import java.util.*; public class product{          public Vector getCategories()     {          Connection con;          Statement st;          ResultSet rs;          Vector ret=new Vector(1,1);          try          {               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");               con=DriverManager.getConnection("jdbc:odbc:Web");               st=con.createStatement();               rs=st.executeQuery("Select * from Categories");               while(rs.next())               {                         ret.add(rs.getString(2));                    );               }          }          catch(Exception e)          {               //System.out.println("Exception...");               ret.add(e.getMessage());          }          return ret;     }}

    Have you downloaded the driver and put it in your Web-Server?
    In tomcat you simply need to copy the file in:
    Tomcat 5.0\common\lib

  • Semmingly intractable JDBC connect problem

    Greetings,
    I am having massive difficulties getting our application to talk to our oracle database. We've (probably unwisely) upgraded the OS to RH9, the database to Oracle 9i and the JDK to 1.3.1 (from RH7, 8i and 1.2).
    The problem is that when I try to connect via JDBC in a jsp, it hangs for a long time and comes back with "ServletException: Io exception: the Network Adaptor could not make the connection." This seems to be a common problem, but I have worked extensively on this, and have tried all the posted remedies I can find: connect URL is verifiably correct, database/listener running, path, networking, different connect methods, etc.
    At a low level, what happens is that the listener establishes the connection, but never recieves a reply back, and I can't determine whether oracle is failing (no trace/log seems to support it) or if JDBC is failing. Since all I get is "Connection failed" in a single method call, I'm not sure how to diagnose that.
    Has anybody seen this before? It's killing me
    Thanks,
    --M                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Can you run a simple app that connects to Oracle successfully, no Tomcat or JSPs involved? I'd try that, if you haven't already.
    Here's a simple Java app that will let you try it:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class ConnectionTest
        public static void main(String [] args)
            try
                if (args.length > 0)
                    Connection connection = ConnectionTest.getConnection(args[0]);
                    DatabaseMetaData meta = connection.getMetaData();
                    System.out.println("Database product: " + meta.getDatabaseProductName());
                    System.out.println("JDBC driver     : " + meta.getDriverName());
                    connection.close();
                else
                    System.out.println("No properties file given");
            catch (SQLException e)
                System.err.println("SQL state: " + e.getSQLState());
                System.err.println("SQL error: " + e.getErrorCode());
                e.printStackTrace(System.err);
            catch (Exception e)
                e.printStackTrace(System.err);
        public static Connection getConnection(final String propertiesName)
            throws ClassNotFoundException, SQLException,IOException
            Properties props=new Properties();
            FileInputStream in=new FileInputStream(propertiesName);
            props.load(in);
            in.close();
            String drivers=props.getProperty("jdbc.driver");
            Class.forName(drivers);
            String url=props.getProperty("jdbc.url");
            String username=props.getProperty("jdbc.username");
            String password=props.getProperty("jdbc.password");
            System.out.println("driver  : " + drivers);
            System.out.println("url     : " + url);
            System.out.println("username: " + username);
            System.out.println("password: " + password);
            return DriverManager.getConnection(url, username, password);
    }Save these properties (changed to your values) to ConnectionTest.properties:
    jdbc.driver     = oracle.jdbc.driver.OracleDriver
    jdbc.url        = jdbc:oracle:thin:@host:1521:SID
    jdbc.username   = username
    jdbc.password   = passwordCompile like this:
    javac ConnectionTest.javaRun like this (assuming ConnectionTest.properties and classes12.jar are in the same directory as ConnectionTest.class):
    java -classpath .:classes.12.jar ConnectionTest ConnectionTest.propertiesIt'll come back and tell you the database vendor name if the connection succeeds. - MOD
    MOD

  • JSP + JDBC + MySql Problem (Tomcat 4.1)

    I'm completely helpless... whenever I try to retrieve stuff from the db (using a jsp page), I get errors that don't even make sense.
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));if I try doing the above, I get a "ServletException : Before start of result set" error that supposedly occurred at this line of the generated servlet:
    if (pageContext != null) pageContext.handlePageException(t);---------------
    If i try this:
    ResultSet rsSec = stmt.executeQuery("SELECT * FROM newsSecTbl");
    rsSec.beforeFirst();  //<-- Even if I don't have this line the result does not change
      out.println(rsSec.next());
      while (rsSec.next()) { ... }I the while loop is never initiated, because rsSec.next() is false... kind of weird if you ask me, I even put two entries into the table to make sure the cursor wasnt at the first record and saying there was no second one (which would have been right if there were only one record).
    I would be very grateful if someone could help me out with this. I've never done any db programming with Java yet, so I dont have a clue what Im doing. By the way, I'm using MySql (indicated in the title) and the server was running and available when I ran the above code.
    Cheers,
    Tom

    You can't do this:
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));The ResultSet you get back is a database cursor that doesn't point to the first row yet. The correct idiom is:
    String sql = "SELECT * FROM newsTbl WHERE articleID = 1";
    ResultSet result = stmt.executeQuery(sql);
    String articleTitle = "";
    while (result.next())
       title = result.getString("articleTitle");
    result.close();
    stmt.close();If you've never done DB programming before, I'd recommend that you click on the Tutorials link to the left and go through the JDBC tutorial carefully. You'll save yourself a lot of grief.
    Another good idea would be to separate out all your database code into at least one separate object, independent of the servlet. That way you can test and develop it off to the side until it's 100% solid. Then your servlet can simply instantiate one and use it. All your problems from that point forward will be servlet issues, because you'll know that your database code is working. - MOD
    See if that works better. - MOD

  • MS SQL Server 2K JDBC Connection Problem

    Hi,
    I have installed Sql Server 2000 with mixed mode authentication. I am able to connect to connect through ODBC with both Windows and server authentication.
    The same when i try with JDBC, i am not able to connect. I have added the driver jars to the classpath also.
    Heres the Code :
    try{
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = java.sql.DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=pubs","sa","");
    if(con!=null) System.out.println("Connection Successful!");
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());
    Here is the error :
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:115)
    at Connect.main(Connect.java:31)
    Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Kindly help.
    Thanks in Advance

    Thanks for the reply.
    I am not using any IDE, but the problem exists if i
    add the jar files into my classpath. I extracted the
    required files as suggested and tried, this time it
    works fine.
    If anyone could let me know why this problem is
    occuring it would be helpful.
    Thanks once againIt occured because MS didn't package their jar properly. You could try to re-jar the files or use a driver from another vendor.

  • Jdbc connectivity problem with mySql

    Hello,
    Could anyone plz help me in solving this problem-
    there are total 3 databases on our site. 2 are old and the 3rd one we created after we installed the new version of mysql(4.1) . Now, we can connect thru over jsp pages to the old databases but when we connect it to the new (3rd ) one it throws the following exception-
    �Java.sql.SQLException: Due to underlying Exception : ArrayIndexOutOfBoundsException.44 Server connection failure during transaction. Attempted reconnect 3 times. Giving up �
    Though the data in the new database is same as in the first database becoz it was just created for testing purpose.
    Is this issue anything to do with the privleges in mysql .plz help........
    Regards

    is this problem related to privleges as i just checked my phpAdmin and there i found this warning-
    �Warning: Your privilege table structure seem to be older than this MySQL version!
    Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem! �
    plz HELP

  • Jdbc connection problem

    Hi All,
    I have problem with connection to Oracle database using both 'oci8' and 'thin' types for java application run within j2ee version 1.2.1 Error messages below.
    If I use oci8 with stand-alone java application the connection and data access work fine.
    I use:oracle 8i (817); jdk 1.2.2; j2ee 1.2.1 on window 2000
    Please help - thanks
    binam
    The Errors: with oci8:
    connection ERROR...access denied (java.lang.RuntimePermission loadLibrary.ocijdbc8 )
    The Error with: "thin":
    oracle.net.TNSAddress.SOException
    at oracle.net.TNSAddress.ServiceAlias.initFromNVPair(Unknown Source)
    at oracle.net.TNSAddress.ServiceAlias.initFromString(Unknown Source)
    at oracle.net.resolver.AddrResolution.resolveAddrTree(Unknown Source)
    at oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
    at oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
    at oracle.net.ns.NSProtocol.connect(Unknown Source)
    at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1213)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:209)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:457)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at Employee.main(Employee.java:23)

    Hello!
    I had this same problem using thin. Then I changed tnsname in getConnection by address:port:sid. Like below.
    conn = DriverManager.getConnection ("jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:SIDNAME","LOGIN","PASSWORD");
    It worked very well.
    null

  • Louts Notes JDBC Connectivity problem

    Hi all,
    I have problem accessing the lotus notes database in my own PC. The error which I have encountered is "SQLException [Lotus][Domino Driver for JDBC] unable to find path to server.
    These are my codings:
    connect instance = new connect();     
    String url = "jdbc:domino:/test.nsf/10.0.0.1";          
    try {
    Class.forName("lotus.jdbc.domino.DominoDriver");
    catch (ClassNotFoundException ce) {
    System.out.println("ClassNotFoundException: " + ce.getMessage());
    try {
    Connection con = DriverManager.getConnection(url,"","");
    } catch (SQLException se) {
    System.out.println("SQLException: " + se.getMessage());
    I have tried to put this file on my root directory, set the path to c:\ and the system prompt me for password but I still get the error message.
    I'm using JDBC 1.1.
    Thanks for all your help in advance.
    Quek

    Thanks for reply but I can't find the forum #48 as the search function doesn't allow me to search by fourm number.
    Can you kindly attach the link when you reply?
    Thanks.

  • Jdbc connectivity problem

    frnds while running the fallowing code i'm getting a problem please help me out
    i'm not getting what to do for this error
    import java.sql.*;
    import java.util.*;
    class DB {    
    public static void main(String[] args) throws Exception
    String driverClass="oracle.jdbc.driver.OracleDriver";
    String url="jdbc:oracle:thin:@servername:1521:p";
    String username="test2";
    String password="abc";
    Class.forName(driverClass);
    Connection conn=DriverManager.getConnection(url,username,password);
    System.out.println("Connection established");
    conn.close();
    for this the errors what i'm getting are
    ---------- while running ----------
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at DB.main(DB.java:10)
    Output completed (0 sec consumed) - Normal Termination

    mr
    i dont no which driver ur using but i am using ur program in oracle driver.i think u give wrong username and password.my program sends to u,ok
    import java.sql.*;
    import java.util.*;
    class Db {
    public static void main(String[] args) throws Exception
    String driverClass="oracle.jdbc.driver.OracleDriver";
    String url="jdbc:oracle:thin:@localhost:1521:xe";
    String username="system";
    String password="tiger";
    Class.forName(driverClass);
    Connection conn=DriverManager.getConnection(url,username,password);
    System.out.println("Connection established");
    conn.close();
    }

Maybe you are looking for

  • Re-installing Adobe Acrobat Prof. XI on a new Laptop

    Dear , I am from Middle-east - Saudi Arabia,  waiting since 4 days to Re-install Adobe Acrobat XI on my New Laptop, sent several messages on Adobe Help emails, No answers. My Laptop was stolen from my Car, and it had a licensed version of Adobe Prof

  • Catastrophic licensing failure ... Creative suite shuts down ... now I can't reinstall it ... HELP!!

    Catastrophic licensing failure ... Creative suite shuts down ... now I can't reinstall it ... HELP!! I was in the middle of a project, not terribly time-sensitive ... YET ... but this is the strangest, most frustrating problem I have encountered with

  • Discoverer plus/viewer

    Dear DBAs, I'm new to applications dba. I want to install Discoverer viewer/plus on my linux server 5.5. Can you please guide me from where can i get discoverer viewer or plus software. and how to install? In my server R12.1.1 is already installed. T

  • Moving onto iPod a Shared source from a PC

    On my iBook G4 is a Music folder via a Shared Link with a PC on my network. Can the ipod attached to the iBook inload that Shared folder or does the folder have to actually reside on the iBook? How can I make it reside on the iBook?

  • Can I transfer voice mail to a new device?

    Can I transfer voice mail to a new device? My father recently passed away and I don't want to lose them.