Sun.jdbc.sql.*

to all:
I had to use the package of "sun.jdbc.sql.*" in jsp environment(<%@page import="sun.jdbc.sql.*"%>),so have downed the component rowset.jar from sun.com and put in my CLASSPATH,but the system coudn't find the package wherever i put the rowset.jar? but it could be found in pure java environment, why?
urgently!!
thanks your help

Have you told you'r servlet engine where to find it?
(If you need a servlet engine to run a jsp..)
In tomcat you add something like this to you'r server.xml file
<!-- Mysql Connection -->
          <Context path="/servlet" docBase="servlet" debug="5" reloadable="true" crossContext="true">
               <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_Absence_log."
                              suffix=".txt" timestamp="true"/>
               <Resource name="jdbc/AbsenceDB" auth="Container" type="javax.sql.DataSource"/>
               <ResourceParams name="jdbc/AbsenceDB">
               <parameter>
                    <name>factory</name>
                    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
               </parameter>
<!-- Maximum number of dB connections in pool. Make sure you
     configure your mysqld max_connections large enough to handle
     all of your db connections. Set to 0 for no limit.
     -->
               <parameter>
                         <name>maxActive</name>
                    <value>100</value>
               </parameter>
<!-- Maximum number of idle dB connections to retain in pool.
     Set to 0 for no limit.
-->
               <parameter>
                    <name>maxIdle</name>
                    <value>30</value>
               </parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
               <parameter>
                    <name>maxWait</name>
                    <value>10000</value>
               </parameter>
<!-- MySQL dB username and password for dB connections -->
               <parameter>
                    <name>username</name>
                    <value>aUsername</value>
               </parameter>
               <parameter>
                    <name>password</name>
                    <value>aPassword</value>
               </parameter>
<!-- Class name for mm.mysql JDBC driver -->
               <parameter>
                    <name>driverClassName</name>
                    <value>com.mysql.jdbc.Driver</value>
               </parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
               <parameter>
                    <name>url</name>
                    <value>jdbc:mysql://<address to the server>?autoReconnect=true</value>
               </parameter>
               </ResourceParams>
          </Context>
Hope it helps some

Similar Messages

  • Is it possible to connect to mysql using sun.jdbc?

    Is it possible to connect to a mysql database using sun's jdbc:odbc driver?
    I develop a page on the internet that uses mysql. The connection code is placed in a java class. I get the errormessage: "no suitable driver" when I try to connect with jsp/java classes.
    If I use PHP it is ok.
    Code:
    $db = mysql_connect("localhost", "vegg", "nbvv2003");
    mysql_select_db("vegg_timereg",$db);
    $result = mysql_query("SELECT * FROM bruker",$db);The java code is like this:
    java.sql.Connection conn = null;
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    try {
          Class.forName(driver);
          conn = DriverManager.getConnection("jdbc:odbc:vegg_timereg","vegg","nbvv2003");
        catch (SQLException e) {
          out.print("<font color=red>Error:</font> SQLException<br>");
          out.print(e.getMessage());
        catch (ClassNotFoundException e) {
          out.print("<font color=red>Error:</font> Driver not found<br>");
          out.print(e.getMessage());
        catch (Exception e) {
          out.print("<font color=red>Error:</font> Error on initializing<br>");
          out.print(e.getMessage());
        }For me it does not seem like there are any drivers available in java, I've tried the sun.jdbc.odbc.JdbcOdbcDriver and org.gjt.mm.mysql.Driver. The mySql driver is missing, so that is the reason, but I do not get an error message when importing the jdbc:odbc driver.
    I do not have permission to check the setup on the webserver:(
    It runs Apache webserver.

    thx, but I don't seem to get any databases. It works when I run it locally, but on the external webserver it doesn't.
    Database info:
    Name: vegg_timereg
    Place: localhost (root)
    Type: mySQL
    It doesn't seem like the mysql driver is installed on the server, so I have to use jdbc. I do not have any permissions on the server, so I can't check it out myself.
    In PHP this connection works:
    $db = mysql_connect("localhost", "vegg", "nbvv2003");
    mysql_select_db("vegg_timereg",$db); I've tried like this (using java.sql.Driver): Class.forName("java.sql.Driver");
    conn = DriverManager.getConnection("jdbc:localhost/vegg_timereg","username","password");This is really annoying when it's so easy on my machine...

  • Use of sun.jdbc.odbc.JdbcOdbcDriver

    Hi, I'm starting to work with Java and I'm trying to connect to a SQL Server 2000 database using "sun.jdbc.odbc.JdbcOdbcDriver" driver but when I try to make the connection I get this error:
    "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Cannot get connection"
    Here is the my code:
    final static private String _driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    final static private String _url = "jdbc:odbc:<databasename>";
    Class.forName(_driver);                    // Load Driver
    c = DriverManager.getConnection(_url, "<user>", "<passwd>");
    } catch (java.lang.ClassNotFoundException e){
    System.out.println(e.toString());
    System.out.println("Cannot find driver class");
    System.exit(1);
    } catch (java.sql.SQLException e) {
    System.out.println(e.toString());          
    System.out.println("Cannot get connection");
    System.exit(1);
    Someone can help me with this ?? I'm stuck !!
    Thanks !!

    Hi, I'm starting to work with Java and I'm trying to
    connect to a SQL Server 2000 database using
    "sun.jdbc.odbc.JdbcOdbcDriver" driver but when I try
    to make the connection I get this error:
    "java.sql.SQLException: [Microsoft][ODBC Driver
    Manager] Data source name not found and no default
    driver specified
    Cannot get connection"
    Here is the my code:
    final static private String _driver =
    "sun.jdbc.odbc.JdbcOdbcDriver";
    final static private String _url =
    "jdbc:odbc:<databasename>"; the DSN that you set up for connecting to your database. is it called <databasename>? somehow i doubt it.

  • JDBC SQL Query Transactionality

    Hi Experts,
    If possible, please can you let me know how the JDBC SQL Query Transactionality works?
    For example, in the JDBC communication channel configuration parameters,
    if I use "SELECT * FROM orders WHERE new = 'TRUE' " for the select query and;
    if I use "UPDATE orders SET new = 'FALSE' WHERE new = 'TRUE' " for the update query;
    does the UPDATE query just update the records contained in that particular record set (for a particular polling instance)?
    What happens if someone inserts new records into the orders table just before the update query executes? Will the update query update those records too? Or just those records in the record set for a particular polling instance? How does XI/PI distinguish between the records contained in the record set for (for a particular polling instance) and the records inserted just before the update query executes?
    Thanks and regards,
    Brendon

    hi,
    as far as I remember this works correctly only when you set Transaction Isolation Levels to repeatable_read or serializable
    have a look at those levels :
    http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/TransactionIsolation.html
    so I guess both of them should prevent situations you're talking about
    Regards,
    Michal Krawczyk

  • Sun.jdbc.JdbcOdbcDriver ClassNotFoundException

    Hello, I'm using Eclipse, I have created a small test class as I have never used SQL before(except for some querying) and have imported the MySQL connector J .jar, and the whole folder directory (just to be sure).
    I keep getting ClassNotFoundException on "sun.jdbc.JdbcOdbcDriver" which is preventing me from getting this to work.
    Is the class name a typo ? or what should the code look like?
    import java.sql.*;
    public class Main
        public static void main(String[] args)
            try
                Connection c = Connect.openDatabase
                ("jdbc:mysql://localhost/booksdb:3306", "root", "dbsd202");
                Statement statement = c.createStatement();
                ResultSet rs = statement.executeQuery("Select * from titles");
                while (rs.next())
                    System.out.printf("%s\t%s\t%s\n",
                              rs.getObject("title"), rs.getObject(1));
            catch (SQLException e)
                e.printStackTrace();
    class Connect
        static Connection conn;
        static Connection openDatabase(String url,String user,String pw)
            try
                Class.forName("sun.jdbc.JdbcOdbcDriver");
                conn = DriverManager.getConnection(url,user,pw);
            catch(Exception e)
                System.out.printf("%s\n", e);
                conn = null;
            return conn;
    }

    I'm not really a java expert, but as far as I know you have to install the jdbc-driver and to add the path to the driver to CLASSPATH-variable.
    If that doesn't help, you shoul post you question in a java forum, e.g. this one:
    http://forums.oracle.com/forums/category.jspa?categoryID=288

  • Sun.jdbc.JdbcOdbcDriver ClassNotFound

    This is a double post sorry, but I must have miss-clicked the wrong forum when posting originally.
    sun.jdbc.JdbcOdbcDriver ClassNotFoundException
    I'm getting class not found exception and I cannot work out why, code is below.
    import java.sql.*; public class Main {     public static void main(String[] args)     {                 try         {             Connection c = Connect.openDatabase             ("jdbc:mysql://localhost/booksdb:3306", "root", "dbsd202");             Statement statement = c.createStatement();             ResultSet rs = statement.executeQuery("Select * from titles");                         while (rs.next())             {                 System.out.printf("%s\t%s\t%s\n",                 rs.getObject("title"), rs.getObject(1));             }         }         catch (SQLException e)         {             e.printStackTrace();         }      } } class Connect {     static Connection conn;     static Connection openDatabase(String url,String user,String pw)     {         try         {             Class.forName("sun.jdbc.JdbcOdbcDriver");             conn = DriverManager.getConnection(url,user,pw);         }         catch(Exception e)         {             System.out.printf("%s\n", e);             conn = null;         }         return conn;     } }

    Darryl Burke wrote:
    G-Unit wrote:
    Never mind solved.And you will share the solution with the community, won't you?
    dbOf course :)
    The class name cannot be found because "sun.jdbc.JdbcOdbcDriver" does not exist.
    The correct class name is "sun.jdbc.odbc.JdbcOdbcDriver".
    The way I found that out was actually searching through the java source code for the class, and I'm assuming that is correct as when I changed it I started getting another error: "java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/booksdb:3306
    Exception in thread "main" java.lang.NullPointerException
         at sql.Main.main(Main.java:26)"

  • MATLAB-JDBC-SQL

    Hello All,
    I was playing around with MATLAB-JDBC-SQL functions, I was successful in making a connection.
    I am using MySQL database
    Here you can see an example
    java.lang.Class.forName('sun.jdbc.odbc.JdbcOdbcDriver');
    url = 'jdbc:odbc:mydb';
    url = java.lang.String(url);
    con = java.sql.DriverManager.getConnection(url,'guest','guest');
    statement=con.createStatement();
    qr='SELECT * FROM var';
    rs=statement.executeQuery(qr);
    i=1;
    while(rs.next())
    result_set.getString(i)
    i=i+1;
    end
    Now, I just want to connect directly to MySQL database without using a ODBC connection.
    for example
    java.lang.Class.forName('sun.jdbc.mysql);
    Does anyone know how to do it?
    Thank you
    likaramuk

    First you get a MySQL jdbc driver. Until you have that you can't do anything else.
    Also note that your subject title was not informative about the question you were asking.

  • How can i put a file into blob(using sun.jdbc.odbc.JdbcOdbcDriver)

    Hi
    i tried to put a file into blob , but got a problem.....
    My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver )
    a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~)
    //Statement stmt2=null;
    //Resultset rs2;
    //opa1 is the blob data
    void saveBlobTableToDisk(Connection con) {
    try {
    stmt2=con.createStatement();
    sqlStr2="SELECT * FROM emp3 where id=1004";
    rs2=stmt2.executeQuery(sqlStr2);
    while (rs2.next()) {
    Blob aBlob=rs2.getBlob("opa1");
    i got the exception :
    " null
    java.lang.UnsupportedOperationException
         at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4174)
         at test3.Frame1.saveBlobTableToDisk(Frame1.java:48)
         at test3.Frame1.<init>(Frame1.java:26)
         at test3.Application1.<init>(Application1.java:5)
         at test3.Application1.main(Application1.java:8) "
    and the windows pop up a messagebox said that(about) my memory "0x09af007f" could not read, error in javaw.exe .
    Later i used (ResultSet)getBinaryStream() to solve it. but getBinaryStream() only return a InputStream,so that i can make blob to a file,but i can't make a file to blob using jdbc.....
    I am very stupid that installing sun java, oracle jdbc driver etc....(because i must set a lot of thing such as classpath,java_home etc), Can i only use JBuilder to do that ?
    Or i must install oracle jdbc driver ?
    Thanks.

    My guess here is that Sun's JDBC-ODBC bridge doesn't handle the BLOB datatype. Most ODBC drivers don't support that datatype, so I wouldn't expect the bridge to.
    Is there a reason that you can't use the Oracle driver?
    Justin

  • Package sun.jdbc.rowset does not exist

    Hi,
    I am tryng to use a CachedRowSet in a JSP page. I got rowset.jar from sun and I put it in my classpath. When I try to import sun.jdbc.rowset I have the message "package sun.jdbc.rowset does not exist".
    Please, could someone help me?
    Tanks,
    Celso

    Hi,
    Unfortunately not... The name of the package is rowset...
    Some others ideas? Thanks,
    Celso

  • The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded with jws

    Hi,
    When I execute my executable jar file, there is no problem but when I open my .jnlp with web start, I obtain my main frame but the queries don't work.
    I have the error message below :
    Java Web Start 1.2 Console, d�marr�e Fri Apr 25 14:55:59 CEST 2003
    Environnement d'ex�cution Java 2 : version 1.3.1 par Sun Microsystems Inc.
    See com.borland.dx.dataset.DataSetException error code: BASE+83
    com.borland.dx.dataset.DataSetException: The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
         at com.borland.dx.dataset.DataSetException.a(Unknown Source)
         at com.borland.dx.dataset.DataSetException.driverNotLoadedAtRuntime(Unknown Source)
    Anyone can help me please?

    Almost certainly, you need to include the JAR file that contains the class in question as a resource in your JNLP. My personal preference for this kind of thing is to have an entry that actually points to another JNLP for the driver (database, e-mail, whatever you need).
    In general, the whole application has to be packaged so that JWS is aware of all the pieces (other than the JRE)--one other thing I've done in some cases is put the driver JAR's into the jre/lib/ext directory.
    HTH,
    J M Craig

  • The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded with I use jws

    Hi,
    I use Java web start and the problem is that java web start can't be loaded the driver.
    Here is my error message :
    See com.borland.dx.dataset.DataSetException error code: BASE+83
    com.borland.dx.dataset.DataSetException: The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
    at com.borland.dx.dataset.DataSetException.a(Unknown Source)
    at com.borland.dx.dataset.DataSetException.driverNotLoadedAtRuntime(Unknown Source)
    at ...
    In my .jnlp I put :
    <resources>
    <j2se version="1.3+" />
    <jar href="ManipulationLigneAS400.jar" /> it's my application
    <jar href="classes12.zip" />
    </resources>
    I don't know what .jar I have to put?
    Someone could help me please?

    Hi,
    see your thread http://forum.java.sun.com/thread.jsp?forum=31&thread=385994
    Ulrich

  • Package jdbc.sql

    we use j2sdk1.4.2_07 and we try to import the package jdbc.sql.* in order to connect our program(which is an applet) with an oracle database, but we receive the following error:"package jdbc.sql does not exist".Does anybody know where we can find the package jdbc.sql.*?
    Thanks.

    There is no package jdbc.sql, like the compiler said. You must mean package java.sql.
    You can't connect an applet directly to Oracle. Better think again.
    %

  • How do I get the SUN jdbc-odbc bridge to work?

    Hi,
    I'm trying to us the SUN 1.2 jdbc-odbc bridge on Oracle 8.
    I have installed the ODBC driver from www.intersolv.com
    (Merant) and have successfully tested it.
    I have SUN 1.2 installed and verified that
    the sun JdbdOdbcDriver is in my CLASSPATH.
    My driver path is:
    sun.jdbc.odbc.JdbcOdbcDriver
    My url is
    jdbc:odbc:Oracle8
    my odbc.ini is correct, and my ODBCINI is set.
    when I try to connect I get "No suitable driver".
    The SUN documentation indicates this error means
    my shared libraries aren't correct, but I have
    verified my ODBC setup with a odbc demo app.
    Any suggestions on how to form my url?
    Has anyone used the bridge on Solaris?
    null

    The display is just too dim.  I tried the brightness and backlight settings and these do not work.  This has been like this since I bought it.  Never bothered to deal with it before and just made do with reading a very dim menu.

  • How to setting up the sun.jdbc driver in servlet

    in my servlet i implemens the MetaData Interface, The Sun JDBC driver was Not support the getMetaData() function .. I dont knw why it was
    Pls hel me

    http://www.apple.com/support/iphone/assistant/airprint/

  • I need a JDBC SQL Grammar

    Hi All,
    I'm working on a project in which I have to translate
    between SQL/400 (for the IBM AS/400) and JDBC
    SQL statements. Rather than working in the dark,
    I'd like to get a grammar for both languages. I'm
    wondering if anyone out there knows where I can
    find one or the other (or both)?
    Regards,
    Stuart ([email protected])

    Well, I wouldn't say there's a difference in grammar. Different SQL dialects use different column type numbers and treat some field types like date fields differently.
    If you want to check out our way of database independence, see subclasses of de.must.dataobj.SQLDialect at http://www.must.de/Jacompe.htm.
    Christoph

Maybe you are looking for

  • My iPhone isn't recognized by iTunes.

    My iPhone isn't recognized by iTunes so I can't synchronize anything. Same thing with my iPad. I tried re installing a couple times already but nothing changed. Does somebody know what else to do?

  • Inserting Clip Art In A Pages 09 Document

    How do you insert clip art in to a Pages 09 document? I am new to iWork after using Appleworks for many years. I have many CDs of Nova Art Explosion Clip Art that I want to use in my documents. I can not seem to find any information on how to insert

  • IPOD Classic 160, Cannot move Games Over to my Ipod

    I just purchased the Classic 160, and everything seems to be fine, except it would not sync my games. I went and purchased new games just to see if they would move over. They did not.

  • Moving Raw Files

    I'm brand new to Bridge, and my issue might reveal that... I typically take pictures in RAW+JPEG, and so have a lot of pics that have a version of each file type. For reasons that would bore the heck out of you, I sometimes want to move the raw file

  • Error on NT with 8.1.6 OCI driver and JDK 1.2

    I have the error: "The procedure entry point slzsetevar could not be located in the dynamic link library oracore8.dll" oracore8.dll is 8.1.5 ocijdbc8.dll is 8.1.6 Any help will be great. Thanks, 8.1.6 OCI driver with JDK 1.2