Connection to Excel using JDBC

Hi
I developed a program to send userid to excel sheet using jdbc...
While i opened excel sheet and try to send data through jdbc it works great ...
But the problem is while i closed the excel sheet and try to send data to excel sheet, it spells success.
But the data i entered is not in that excel sheet ...
What to do .???
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class InsertExcel
static JFrame frame;
static JPanel panel;
static JTextField textuserid;
static JTextField textfirstname;
static JTextField textlastname;
static JButton submit;
static JButton exit;
public static void main(String args[])
frame = new JFrame("Inserting to excel sheet");;
panel = new JPanel();
JLabel labeluserid = new JLabel("User id ");
JLabel labelfirstname = new JLabel("First Name");
JLabel labellastname = new JLabel("Last Name");
textuserid = new JTextField(20);
textfirstname = new JTextField(20);
textlastname = new JTextField(20);
submit = new JButton("Submit to Excel sheet");
exit = new JButton("Exit");
panel.add(labeluserid);
panel.add(textuserid);
panel.add(labelfirstname);
panel.add(textfirstname);
panel.add(labellastname);
panel.add(textlastname);
panel.add(submit);
panel.add(exit);
frame.getContentPane().add(panel);
frame.setSize(1024,100);
frame.setVisible(true);
frame.setDefaultCloseOperation(3);
submit.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
     try
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection con = DriverManager.getConnection("jdbc:odbc:Excel Files","","");
          PreparedStatement stat2 = con.prepareStatement("insert into
[Book1$](USERID,FIRST_NAME,LAST_NAME) values (?,?,?)");
          stat2.setString(1,textuserid.getText());
          stat2.setString(2,textfirstname.getText());
          stat2.setString(3,textlastname.getText());
          stat2.executeUpdate();
          JOptionPane.showMessageDialog(frame,new String("Successfully entered to excel sheet !!!"));
     catch(Exception e1)
          JOptionPane.showMessageDialog(frame,new String("Error while inserting to excel sheet !!! \n" +
e1));
exit.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ex)
     System.exit(0);
}

I think this thread has been cross-posted

Similar Messages

  • Connecting to Oracle using JDBC

    Hi all,
    I am a new to Oracle. I am trying to connect to Oracle using JDBC
    The URL with which I tried to connect was:
    jdbc:oracle:oci8:@myServiceName,user='myLogin',password='myPassword'
    I get an error (ORA-12154)
    - TNS could not resolve service name
    When I use the same userid, password and service and connect thru' SQL*Plus it goes thru'. Is there any parameter which I am missing. Can anyone throw some light on this. I am held up with this issue badly.
    Thanks for all your help and time.
    Regards,
    Latha

    Hi Latha,
    Please try to use thin and add port number.
    m_conn = DriverManager.getConnection("jdbc:oracle:thin:@" + hostURL + ":" + port + ":" + database, user, password);
    Hong
    null

  • Connect Flat files using jdbc

    Hi,
    I have a problem with connecting flat files(.txt, .xml, .csv, .xls, etc...) which is existing in application it's self, using jdbc connection.
    After searching I found some suggestions below.
    1)xlsql
    2)JDO
    I tried with first one (xlsql), below is the process. First create core java project and load the jar files which is from xlsql. below is the code
    Class.forName("com.nilostep.xlsql.jdbc.xlDriver");
    final String dir = System.getProperty("user.dir")+"\\db\\xl";
    conn = DriverManager.getConnection("jdbc:nilostep:excel:/"+dir);
    Statement stmt = con.createStatement();
    String sql = "select * from Sheet1$";
    ResultSet rs = stmt.executeQuery(sql);
    if(rs.next()){
    System.out.println(rs.getString(1));
    }else{
    System.out.println("nodata....");
    It is saying Sheet1$ table not existing.
    Please help me.

    Not quite sure of your definition of a flat file, but a .xls files is a Microsoft Excel workbook, which is saved in a proprietary binary format, so there's certainly nothing 'flat' about it.  Of course, there are odbc and suchlike drivers for treating Excel workbooks as data sources, but you need to ensure when you query them that you know the details of the workbook.
    In each workbook, each spreadsheet has a name (as defined on it's tab at the bottom).  That is taken to be the name of the 'table' that you use when you query it with SQL.
    On each spreadsheet, row 1 of that sheet should denote the column names of the 'table'
    All subsequent rows on the spreadsheet are the data that will be returned from querying it.
    Typically, the data on the sheets should be fairly straightforward, in order to query it.  Some excel functionality may prevent it being queried properly.

  • Cannot connect to database using JDBC

    Hello!
    I am trying to connect to my local database using this script:
    import java.sql.*;
    public class test{
    public static void main (String[] args){
      try
        DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
        Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
        Statement StmtPersoane = conn.createStatement();
        ResultSet CrsPersoane =StmtPersoane.executeQuery("select p.* from personal p");
        int jMarca = 0;
        while(CrsPersoane.next()){
        jMarca = CrsPersoane.getInt("marca");
        System.out.println(jMarca);
        CrsPersoane.close();
        StmtPersoane.close();
        conn.close();
      catch(SQLException e)
        e.printStackTrace();
    }When compiling i am getting this error: Error(7,58): cannot access class oracle.jdbc.driver.OracleDriver; file oracle\jdbc\driver\OracleDriver.class not found
    I have set a CLASSPATH enviroment variable with value : D:\oracle10g\product\10.1.0\Db_1\jdbc\lib\ojdbc14.jar
    Please provide some hints. Thanks in advace !

    Problem solved with the connection, but now i'm getting another error when i am trying to parse an error. Here is the code a little bit modified:
    import java.sql.*;
    import java.text.*;
    import java.text.ParseException;
    import java.util.*;
    public class test{
    public static void main (String[] args){
      try
        DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
        Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
                Statement StmtPersoane;
                StmtPersoane = conn.createStatement();
                ResultSet CrsPersoane =StmtPersoane.executeQuery("select marca from personal");
                int jMarca;
                jMarca = 0;
    java.util.Date dataJava = new java.text.SimpleDateFormat("dd/mm/yyyy").parse("04/10/2006");
    java.sql.Date dataSql = new java.sql.Date(dataJava.getTime());
    System.out.println("Data: "+dataSql);
        System.out.println("Angajatii sunt:"); 
                while(CrsPersoane.next()){
        jMarca = CrsPersoane.getInt("marca");
        System.out.println(jMarca);
        CrsPersoane.close();
        StmtPersoane.close();
        conn.close();
      catch(SQLException e)
        e.printStackTrace();
    }The error:
    Error(24,81): unreported exception: java.text.ParseException; must be caught or declared to be thrown
    Any ideas ?

  • Connecting to Oracle using JDBC problem

    When trying to connect using the following few lines:
              String urn = "jdbc:oracle:thin:@localhost:1521:XE";
              Class.forName("oracle.jdbc.driver.OracleDriver");
              Connection _con = DriverManager.getConnection(urn, "user", "pass");
    I get an ArrayIndexOutOfBounds Exception
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
         at oracle.security.o3logon.C1.r(C1)
         at oracle.security.o3logon.C1.l(C1)
         at oracle.security.o3logon.C0.e(C0)
         at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
         at oracle.jdbc.ttc7.O3log.<init>(O3log.java:287)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:227)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    I am using JDK 1.4, and I installed the Oracle Database 10g Express Edition.
    If anyone has used JDBC before, and knows how this should be done...
    thanks

    Hi All,
    Even im facing similar issues, please advise and help. Details as below,
    System and java spec used:
    Windows Edition : Windows Server 2008 R2 Standard
    System type : 64-bit Operating System
    NetBeansIDE version : 6.1
    JDK Version : 1.6
    DB : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Connection string: : <root>
    <title>Oracle R12 Prod</title>
    <jdbc-connection-string>jdbc:oracle:thin:<username>/<password>@<host>:<port>:<SID></jdbc-connection-string>
    </root>
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.security.o3logon.C1.r(C1)
    at oracle.security.o3logon.C1.l(C1)
    at oracle.security.o3logon.C0.c(C0)
    at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
    at oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
    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:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at db.dbConnect.makeConnection(dbConnect.java:55)
    at org.apache.jsp.rep.rep1_005fgo_jsp._jspService(rep1_005fgo_jsp.java from :222)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:660)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:578)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:997)
    at org.apache.jsp.rep.rep1_005fgo0_jsp._jspService(rep1_005fgo0_jsp.java from :111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

  • Connecting to SQL Using JDBC - Help!

    Hi All
    I am looking to create some conections to various custom SQL DBs so that I can produce reports and queries using visual composer. I have various Stored procedures DTS and tables I need to access.
    I have no idea where to start with this, only that I need to use JDBC. Does anyone have or can point me in the right direction on how to set up these systems in the portal. I have EP7.0 SP8.
    Many thanks for your help and time
    Phil

    Hi Phil,
    you can find a good example on:
    https://www.sdn.sap.com/irj/sdn/visualcomposer?rid=/library/uuid/16244247-0a01-0010-3294-d81c21e7e86e
    With JDBC Systems you can call stores procedures and with BI JDBC Systems you can see the tables and views.
    You can create a standar JDBC using the portal Wizard and the BI JDBC systems with:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Best Regards.
    Nacho

  • Problem connecting to Mysql using JDBC

    Hi Everyone,
    I am trying to connect Mysql ad java applet and I am using the Mysql jdbc connector.
    I Took the mysql-connector-java-5.0.8-bin.jar file and put that in the library of jdk.
    Now i used the following code to connect to the database using Netbeans.
    package testmysql;
    import java.sql.*;
    public class Main
    public static void main (String[] args)
    Connection conn = null;
    try
    String userName = "root";
    String password = "";
    String url = "jdbc:mysql://localhost/rpms";
    Class.forName ("com.mysql.jdbc.Driver").newInstance ();
    conn = DriverManager.getConnection (url, userName, password);
    System.out.println ("Database connection established");
    catch (Exception e)
    System.err.println ("Cannot connect to database server");
    finally
    if (conn != null)
    try
    conn.close ();
    System.out.println ("Database connection terminated");
    catch (Exception e) { /* ignore close errors */ }
    But it displays Cannot connect to database server
    thoughMysql server is running.
    Can anyone tell me wats the prob in this.
    thanks

    String url = "jdbc:mysql://localhost/rpms";
    Class.forName ("com.mysql.jdbc.Driver").newInstance ();
    Is rpms the MySQL database?
    Is the database on the default port 3306?
    Is the MySQL JDBC JAR file in the classpath of the applet?
    newInstance() is not required to be invoked unless using <= JDK 2.0
    Replace:
    catch (Exception e)
    System.err.println ("Cannot connect to database server");
    with:
    catch (Exception e)
    System.err.println (e.getMessage());
    Edited by: dvohra09 on Apr 10, 2009 10:54 PM
    Edited by: dvohra09 on Apr 10, 2009 10:55 PM
    Edited by: dvohra09 on Apr 10, 2009 10:58 PM

  • Not able to connect to database using jdbc

    Respected sir/madam,
    I am new to java and i am trying to connect to database which is necessary for me in project when i wrote the code using class.forName i am able to compile but when runnig i am getting two exceptionns one is oracle.jdbc.driver.oracledriver not found or excetion in thread main class not found please help me

    Subash,
    1) Please refrain from cross-posting (posting the same message into two or more forums). This question was better asked in the JDBC forum as you eventually put it but you already posted here so if that happens again next time just leave the original thread be.
    2) Your compilation classpath and your runtime classpath are not related. As a matter of fact with well written JDBC code and under most conditions you should not need your driver in your compilation classpath at all, only your runtime one.
    3) Your driver is not in your runtime classpath. That is the error that you need to resolve.

  • Connect Ms-Access using jdbc in local

    I'm having a problem on connecting my java application with my Access database. My Access database and class file is locate in c:\jdbc folder. Below is my code. Anyone know what wrong it is?
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String dbURL = "jdbc:odbc:C:\\jdbc\\students.mdb";
    connection = DriverManager.getConnection(dbURL);

    It's work now... but I want to learn how to configure
    my ODBC driver. Anyone can help or any place website
    that can help me get this resolves?
    sorry for asking this silly question. I'm not only new
    in Java but also RDBMS and my java book never teach
    this things... :(If you are working on windows platform,
    Start-->Settings-->Control Panel-->Data Sources(ODBC)-->User DSN or System DSN-->Add-->Microsoft Access Driver-->Finish
    Now you would have got ODBC Microsoft Access Setup.
    Enter DSN name and select the database, click on advanced and enter username and password. Thats all.
    You can use int in your pgm,
    connection = DriverManager.getConnection(dbURL,username,password);
    Sudha

  • Connecting to Oracle using JDBC issue

    Hi All,
    Im facing similar issues, please advise and help. Details as below,
    System and java spec used:
    Windows Edition : Windows Server 2008 R2 Standard
    System type : 64-bit Operating System
    NetBeansIDE version : 6.1
    JDK Version : 1.6
    DB : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Connection string: : <root>
    <title>Oracle R12 Prod</title>
    <jdbc-connection-string>jdbc:oracle:thin:<username>/<password>@<host>:<port>:<SID></jdbc-connection-string>
    </root>
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.security.o3logon.C1.r(C1)
    at oracle.security.o3logon.C1.l(C1)
    at oracle.security.o3logon.C0.c(C0)
    at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
    at oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
    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:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at db.dbConnect.makeConnection(dbConnect.java:55)
    at org.apache.jsp.rep.rep1_005fgo_jsp._jspService(rep1_005fgo_jsp.java from :222)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:660)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:578)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:997)
    at org.apache.jsp.rep.rep1_005fgo0_jsp._jspService(rep1_005fgo0_jsp.java from :111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

    Can someone please help me on the above query

  • Can't connect to MSSQL using jdbc type 4

    My settings in the server are the followings:
    Data source class name : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Resource Type: javax.sql.DataSource
    And in the properties, i have added
    DatabaseName: jdbc:microsoft:sqlserver://SQL_SERVER:1433;DatabaseName=Borrar
    Because i have downloaded the jdbc driver type 4 sp3 from microsoft site, in the AppSrv-->JVM Settings --> Path Settings -->Classpath Suffix I have the following:
    C:/Sun/AppServer/pointbase/lib/pbclient.jar
    C:/Sun/AppServer/pointbase/lib/pbembedded.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/msbase.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/msutil.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/mssqlserver.jar
    Using this configuration, when i press the button "Ping" when i'm configurating the connection pool, i have this message:
    " An error has occurred.
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. "
    Anyone can help me ??

    Since nobody posted the solution and I happened to found one, I want to contribute with the following information. Hope this helps:
    In order to create a connection pool for MSSQLServer
    you have to:
    1. Copy these files to the lib carpet inside domains/domain/DOMAIN_NAME/:
    mssqlserver.jar,
    msutil.jar,
    msbase.jar.
    You can find them in www.microsoft as a single package. Just look for JDBC Driver.
    2. In the administrator console of the AppServer, go to:
    Application Server -> JVM Settings -> Path Settings -> Classpath Suffix -> , and right there add the path for the previous files.
    Press 'Save' and restart the server.
    3. Go to JDBC -> Connection Pools -> New...
    Resource Type: javax.sql.DataSource'
    Database vendor: (none) (Dont select anything here).
    Press Next.
    4. In the field for Datasource ClassName, add
    com.microsoft.jdbcx.sqlserver.SQLServerDataSource
    (Here is where I`ve been having problems. I used to put com.microsoft.sqlserver.SQLServerDriver).
    5. The way to find out that the server found de library is through the attributes. You have to see exactly, among others:
    DatabaseName, SelectMethod, Password, User, PortNumber,ServerName.
    If you see: Port. It means the path to the library is wrong.
    6. Inform exactly the previous fields:
    DatabaseName= yourDBName
    SelectMethod=cursor
    Password=yourDBPassword
    User=yourDBUser
    PortNumber=1433
    ServerName=yourServerName
    7. That�s it. Press finish. and then select the connection you just created and hit ping. You shouldnt see the annoying message about some "MBEAN bla bla bla".
    Good luck. Greetings from Costa Rica.

  • Help connecting to sqlserver2000 using JDBC

    Hi there..
    i'm student and i want to make
    connection to sqlserver2000 please if any one can explain the steps because i read some code but it did not work with me
    so I want explanation to the steps with sample codes
    thank you
    yours sincerely,
    alaa

    http://java.sun.com/docs/books/tutorial/jdbc/
    %

  • Connect to oracle using jdba thin driver

    i want to use jdbc thin driver to connect to oracle 8i for linux intel.
    my code is:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String dbURL = "jdbc:oracle:thin:@dbserver:1521:iasdb";
    Connection con = DriverManager.getConnection(dbURL,"scott","tiger");
    but an error is reported as "the network adapter can not establish connection".
    why?
    i can connect to oracle using JDBC-ODBC bridge successfully.

    i want to use jdbc thin driver to connect to oracle 8i for linux intel.
    my code is:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String dbURL = "jdbc:oracle:thin:@dbserver:1521:iasdb";
    Connection con = DriverManager.getConnection(dbURL,"scott","tiger");
    but an error is reported as "the network adapter can not establish connection".
    why?
    i can connect to oracle using JDBC-ODBC bridge successfully.

  • How to run Excel Macros using JDBC-ODBC

    Hi,
    I want to run the excel macros in the excel file, after I connected to excel file, using JDBC-ODBC bridge.
    How macros treated here?
    Help needed please..........
    - Ramesh

    How to run Excel Macros using JDBC-ODBCYou don't.
    As my fuzzy understanding goes.....
    Macros (excel, word, etc) run via a "OLE" extension of the script host system.
    So the only way to run them is via the OLE interface. That has nothing to do with ODBC. You can write your own JNI to do that, or you might get lucky and find that someone else has written a java library to do it for you.

  • Retrieval of Information from Excel Sheet using JDBC-ODBC

    Hello,
    Currently I am writing a program that extracts information fromexcel sheet. This excel sheet have some values in Chinese. I am able to extract English character from the different column in excel, but if some column contain chineese valur then it prints ???. After that I looked on net and found some details in to convert Big5 (Chinese) character into unicode, but this is not working and in that case nothing is displayed. I am attaching the my code. In my code the 'customer' field contain chinese character.
    import java.io.ByteArrayInputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.io.Reader;
    import java.io.IOException;
    import java.sql.*;
    public class ExcelJDBC
         Connection con;
         Statement stmt;
         public ExcelJDBC(String url)
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              catch(java.lang.ClassNotFoundException e)
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try
                   con = DriverManager.getConnection(url, "", "");
                   stmt = con.createStatement();
              catch(SQLException ex)
                   System.out.println("SQL EXCEPTION OCCURED");
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
         public void sql(String sql)
              try
                   stmt.execute(sql);
              catch(SQLException ex)
                   System.out.println("SQL EXCEPTION OCCURED");
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
         public void closeAll()
              try
                   stmt.close();
                   con.close();
              catch(SQLException ex)
                   System.out.println("SQL EXCEPTION OCCURED");
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
         //big5 to unicode conversion
         private String b2u(String str2convert) throws IOException
              System.out.println("The input string is :" + str2convert);
              StringBuffer buffer = new StringBuffer();
              byte[] targetBytes = str2convert.getBytes();
              ByteArrayInputStream stream = new ByteArrayInputStream(targetBytes);
              InputStreamReader isr = new InputStreamReader(stream,"Big5");
              Reader in = new BufferedReader(isr);
              int chInt;
              while((chInt = in.read()) < -1)
                   buffer.append((char)chInt);
              in.close();
              System.out.println("The output string is :" + buffer.toString());
              return buffer.toString();
         public void sqlQuery(String sql)
              try
                   ResultSet rc = stmt.executeQuery(sql);
                   if(rc != null)
                        int count = 0;
                        while (rc.next())
                             String value = "";
                             value = b2u(rc.getString("workorder"));
                             System.out.println("The workorder is : "+value);
                             String customer = rc.getString("Customer");
                             value = b2u(customer);
                             System.out.println("The Customer is : "+value);
                             count++;
                        System.out.println("Entering in loop " count " time.\n");
              catch(SQLException ex)
                   System.out.println("SQL EXCEPTION OCCURED");
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
              catch(IOException ex)
                   System.out.println("IO EXCEPTION OCCURED");
                   System.err.println("IOException: " + ex.getMessage());
                   ex.printStackTrace();
    public static void main(String[] args)
         String url = "jdbc:odbc:detailsdsn";     
         try
              ExcelJDBC ej = new ExcelJDBC(url);
              ej.sqlQuery("SELECT \"workorder\", \"Customer\" FROM \"Sheet1$\"");
              ej.closeAll();
         catch(Exception ex)
              System.out.println("SQL EXCEPTION OCCURED");
              System.err.println("SQLException: " + ex.getMessage());
              ex.printStackTrace();
    I will highly appriciate any answer of my problem.
    Regards,
    Ruchi

    Try to find out, what characters really are in your string customer.
    I assume you used System.out.print..(), when you got them as '?'.
    Find out which unicodes they are!
    Afterwards I see two possibilites:
    Either
    1) you see real unicodes for Chinese characters, and it was only the unability of System.out to print them others than as '?', then you can convert these characters however you want. Maybe your further processing can handle them directly as unicode.
    or
    2) you get really '?' in your string. Then Excel (or JDBC or ODBC or ???) hasn't been able to transmit these Chinese characters to your program others than converting them all into '?'. Then you are lost, because you can't know which Chinese character each '?' originally could have been.
    Hope this helps.
    Please tell us, which you experienced, 1) or 2).

Maybe you are looking for

  • Issue of Personalization error while running Photoshop ver.8 on Win 7

    I recently upgraded my operating system to Windows 7 Enterprise edition (ver 6.1.7600 Build 7600) from Windows XP Professional. Now the issue is that after installing the licensed version of Adobe Photoshop CS (Adobe Creative Suit CS) on Win 7, I am

  • Wscompile: compilation error

    Hi all, I am using wscompile to create a web service client from a wsdl file. I get an error during compilation caused by some strange symbols in the generated code. Has anyone an idea what may be wrong ? Or is it a bug in wscompile ? Kind regards Ad

  • Variables in Authorizations

    Hello Gurus,        I hope you can help me with a problem. We use BI7 and at the moment we have 3 authorisation relevent objects Sales Office, Cost Centre and Sold To. We load this data via spreadsheets for each user, some will have a * and some will

  • 7.01 Reinstaller for QT 7.03 ???

    I just upgraded QT 7.01 to 7.03 and as with the 7.02 upgrade i am now having problems with the AC3 audio on my AVI movies. Before it was just the sound but now when i try to play the movies it crashes my machine and i have to switch it off and on aga

  • Compiling file with servlet.jar

    Hi, I can compile my file under the arm/pdm package fine by using this command: javac -classpath .;.. pdm\FileName.java but now i wrote a servlet which imports the javax.servlet directory. So in order for the class to compile i have to give it the pa