Jdbc-odbc-bridge connection pool

I got a problem with odbc connection pool in my Sun App Server 7.
When i try to connect to the odbc database (msaccess or conzept16), i got a SQLException : com.sun.enterprise.repository.J2EEResourceException
java.lang.NoSuchMethodException: setdatabaseName .....
It seems that i cant set any propertys like url, user or password. The exception throws every time NoSuchMethodException: setURL or ... NoSuchMethodException: setUser
I tried this with pointbase database and pointbase drivers and there was no problem. Also when i connect direct from jsp page to the odbc database without connection pool it works.
How can i set a propper connection pool with the jdbc-odbc-bridge? Please Help. There is no jdbc driver for that database available.
Is that right using sun.jdbc.odbc.JdbcOdbcDriver for that?
here my server.xml
<resources>
<jdbc-resource enabled="true" pool-name="access-pool" jndi-name="jdbc/AccessDB"/>
<jdbc-connection-pool steady-pool-size="2" max-pool-size="6" max-wait-time-in-millis="60000" pool-resize-quantity="2" idle-timeout-in-seconds="300" is-isolation-level-guaranteed="false" is-connection-validation-required="false" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="sun.jdbc.odbc.JdbcOdbcDriver" name="access-pool" validation-table-name="TAB_NAME">
<property value="jdbc:odbc:testdb" name="databaseName"/>
</jdbc-connection-pool>
</resources>

AFAIK the bridge driver does not support multipleopen
connections (which is what connection pooling
requires).Wrong.
It might be the case that the bridge AND ms access
does not support that but I seriously doubt that as
well.
Yesterday I didn't want to test this. Today I did.
So I can state that it is completely wrong.
There might be some other reason preventing the usage in a pool, but it isn't the number of open connections.

Similar Messages

  • JDBC ODBC bridge connections using 2.1.1

    Hi,
    I have reviewed a lot of postings related to JDBC and third party drivers and understand how to connect to the packaged drivers such as MySQL and MS SQL Server/Sybase. Where I'm stuck is the reference in the Connections help to JDBC. We have a ODBC system DSN that's not part of the existing JDBC drivers. The help implies it's possible to create a JDBC:ODBC bridge connection and that JDBC:ODBC bridge functionality is part of the JDK therefore should not require additional jar files. However, the JDBC tab is not an available connection type by default. I traced the JDBC ODBC bridge to the rt.jar and tried adding that to the third party extensions but that has not resulted in the JDBC tab becoming available.
    Is the JDBC tab only available when using commercial JDBC ODBC bridge drivers ?
    For all other connections (DB2, TimesTen, Teradata etc) the help is very specific about which jar files you need and any other requirements but the JDBC section it is unclear how you enable JDBC connectivity.
    Thanks
    Steven
    Edited by: slisint on 14-Jan-2011 18:07

    We are using the JDBC-ODBC bridge to do a prepared
    statement. I have seen other bugs that suggest this
    is problematic with older version of JRE, but was
    supposedly fixed in later versions.
    java.sql.SQLException: General errorIf it is not too late, check the following link:
    http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/GettingStartedTOC.fm.html
    Sections 6.1.3 and 8 (especially tables at the end).
    I had the same case, and the problem was that the field in the Oracle database was defined as NUMBER(4), witch is equivalent to INTEGER in JDBC types, and function setInt should be used with INTEGER, instead of setLong.
    This is explained in sections I mentioned.

  • Jdbc-odbc bridge connection error

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

  • JDBC-ODBC-Bridge connection to SQL Database

    Hi guys
    I have a problem. I've made a little game which I want to put on my website. It has a highscore-list which I want to connect to my web host's database server to get the current list.
    I tried this with JDBC and got it to work locally but when I uploaded it to my site it didn't work. I contacted my web host's technical support who told me that their server didn't have the JDBC driver and that I should use ODBC instead. I did lots of reading and found out about this JDBC-ODBC-Bridge. I have since been trying to implement this into my program but hasn't been successful.
    In my original JDBC connection I used
    private String url = "jdbc:mysql://" + host +  "/" + mydatabase;
    Class.forName("com.mysql.jdbc.Driver");
    Connection connection = DriverManager.getConnection(url, username, password);Now I'm trying
    private String url = "jdbc:odbc://" + host + "/" + database;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection(url, username, password);But, at least when trying it locally, I get the error
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name is too long.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at HighscoreDB.readFile(HighscoreDB.java:53)
    at HighscoreDB.displayList(HighscoreDB.java:97)
    at HighscoreDB.main(HighscoreDB.java:33)Please help ;)
    Edited by: YZF-R1 on 2009-apr-09 13:26

    YZF-R1 wrote:
    masijade. wrote:
    Do you know what ODBC is?I think I at least have the basic idea, I learnt most of what I know from this post:
    [http://forums.sun.com/thread.jspa?threadID=211735&start=2&forumID=48]
    masijade. wrote:
    While "reading about this JDBC-ODBC Driver" did you also read about how to enter the URLs for it?No, I couldn't find that piece of information, why don't you tell me ;)
    Here
    >
    masijade. wrote:
    Did also read about the fact about needing to configure ODBC DSNs? Or about the fact that the connection URL is radically different if you don't configure one?No I did not. Please explain =)
    Here
    >
    PhHein wrote:
    Plus, JDBC-ODBC Bridges are evil!I'm beginning to realize this myself :O:(
    BalusC wrote:
    Drop that whole ODBC idea and just gently read the documentation which come along with the MySQL JDBC driver.I read a lot of it when I used the JDBC driver locally but how's that going to help me if the server doesn't have the JDBC driver installed?How will the Bridge help you if the ODBC Driver is not installed? And, the JDBC Driver (the Type 4.0 ones, which the MySQL Driver is) is 100% Java, so it can even be included in an Applet, if the HTML page that accesses it is done right, and the jars are "packaged" properly.

  • JDBC-ODBC bridge connection failure.

    I'm new to JDBC and JDeveloper and am having some difficulty
    getting through the database applet tutorial.
    I'm trying to connect to a Microsoft Access database using the
    JDBC-ODBC Bridge. This is an interim stage before using a Linux
    Oracle database which is not yet up and running.
    When trying to add a data form, the database wizard fails at
    step 4 of 7 after selecting the Sun JDBC-ODBC bridge and the
    required data source the following error is presented:
    Connection error
    Vendor code 84
    [Microsoft][ODBC Microsoft Access 97 Driver]Driver not capable
    I also tried setting up (using ODBC manager) a System DSN for a
    text and Excel data source, but met similar problems e.g:
    [Microsoft][ODBC Excel Driver]Driver not capable
    Currently JDeveloper Beta 2.0 (build 184) and the ODBC source
    are on the same NT4.0 (SP4) machine.
    To confuse matters I'm actually running Access 95, rather than
    Access 97.
    I have previously successfully connected to an Access ODBC
    source via JDBC in a Java application (not applet) when
    following a tutorial example that comes with the Sun JDK 1.2. I
    note, however, that jdbcodbc.dll that's part of JDK 1.2 is newer
    (and bigger - 32K 01Dec98) than that supplied with the
    JDeveloper Beta 2.0 (22K 05Nov98)
    I'm a bit lost with this problem since nothing happens after
    pressing help on the error dialog, and I'm not sure where to
    look for log files etc. to further debug the problem. Any help
    would be gratefully received!
    null

    The error indicates that the bridge is making a call to the
    driver which it cannot handle -- either because the call is
    invalid/unreasonable or because the driver doesn't implement the
    functionality requested. An ODBC trace will determine which of
    the two is true. If the first, you need to contact the bridge
    provider to get a fix. If the second -- the ODBC driver
    provider.
    null

  • Problem With Jdbc-Odbc BRidge Connection

    I get The following error
    SQLException:[Microsoft][ODBC Driver Manager] Invalid cursor state
    when using the code
    whats the problem with it
    import java.sql.*;
    public class Employee {
    String DBurl;
    Connection con;
    public Employee(String url)
    DBurl=url;
    void queryTest()
    String query="SELECT * FROM EmpTable";
    ResultSet result;
    Statement stmt;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(java.lang.ClassNotFoundException e){
    System.err.println("Class not Found Exception:");
    System.err.println(e.getMessage());
    try{
    con=DriverManager.getConnection(DBurl,"myLogin","mypassword");
    stmt=con.createStatement();
    result=stmt.executeQuery(query);
    System.out.println("ID"+"\t"+"Name"+"\t"+"Rate"+"\t"+"DeptID");
    System.out.println("--"+"\t"+"----"+"\t"+"---"+"\t"+"----");
    while(result.next());
    String name=result.getString("Name");
    int ID=result.getInt("ID");
    float rate=result.getFloat("Rate");
    int deptID=result.getInt("DeptID");
    System.out.println(ID+"\t"+name+"\t"+rate+"\t"+deptID);
    stmt.close();
    con.close();
    catch(SQLException ex){
    System.err.println("SQLException:" + ex.getMessage());
    public static void main(String args[])
    Employee app = new Employee("jdbc:odbc:Employee");
    app.queryTest();
    }

    here's your mistake:
    while(result.next());  // <--- the loop body is empty.Remove the semi-colon.
    %

  • JDBC-ODBC Bridge Performance To MS Access

    Hey all, I'm running a Java app that extracts an entire table (set of tables) from Oracle and copies them into Access. The easiest implementation has been to use a DSN-less Type 1 JDBC-ODBC bridge connection to Access, but unfortunately the inserts are taking too long.
    I have tried both Statement and PreparedStatement approaches, with both single row and batch updates. Some of the performance times, relative to the computer I am on (PIII 1 gHz with 256 RAM), are as follows:
    Via Batch, about 8min, 15 seconds per 10,000 rows.
    Via Single Row updates/inserts, about 52 minutes for 45,000 rows.
    I've tried alot of varieties with batch, but 10,000 seemed to be the best. The largest table is only 45,000 rows (right now), but has the potential to grow much larger (obviously). This application needs to backup 4 databases, each with N tables (current N=7, but will expand). I'm trying to knock down the times and increase performance, but am not sure what is "reasonable" for Type 1 connections with JDBC. I've seen third party drivers, Type 3, for Access...but don't want to run the middle tier server for filtering request through. I'd rather use Type 4, but can't seem to find any for Access.
    Any suggestions? Recommendations? Let me know! Thanks all! :)

    Hi,
    If its a backup/batch process why are you worrying about performance, its only an offline process :) even if has to be triggered during an OLTP run this task asynchronously.
    I dont know why you have chosen java to do this ??? any way prepared statements with non scrollable resultsets will increase you performance better tha scrollable normal statements.
    Rajesh

  • What's the URL in a JDBC-ODBC bridge driver connection?

    I'm trying to use a JDBC-ODBC bridge driver but I don't know what is the URL I need to put inside a the "getConnection (String URL, String userid, String passwd)" method.
    Connection conn = DriverManager.getConnection(URL, user, passwd);
    Can anybody help me?

    Yes Marc,
    but maybe Edgar should know that he first has to add a ODBC datasource.
    in WINNT
    Goto System ODBC Datasources and try to connect to your DB.
    If the test is working than you can use the name you have chosen
    as URL
    good luck
    Stefan

  • Connecting remote FoxPro dbf file using jdbc odbc bridge driver?

    Hi all,
    I am new to this topic, (even I read some threads)
    I need to access some FoxPro tables (dbf files) and select some data and save to an oracle table. what is the best method to do this?
    If I use java as development tool. which other drivers or methods to use beside jdbc-odbc driver?
    I read from this link but I didn't understand.
    http://java.sun.com/products/jdbc/faq.html#5
    "5. How can I use the JDBC API to access a desktop database like Microsoft Access over the network?
    Most desktop databases currently require a JDBC solution that uses ODBC underneath. This is because the vendors of these database products haven't implemented all-Java JDBC drivers.
    The best approach is to use a commercial JDBC driver that supports ODBC and the database you want to use. See the JDBC drivers page for a list of available JDBC drivers.
    The JDBC-ODBC bridge from Sun's Java Software does not provide network access to desktop databases by itself. The JDBC-ODBC bridge loads ODBC as a local DLL, and typical ODBC drivers for desktop databases like Access aren't networked. The JDBC-ODBC bridge can be used together with the RMI-JDBC bridge, however, to access a desktop database like Access over the net. This RMI-JDBC-ODBC solution is free.
    "

    Another solution by using HXTT DBF, a commercial type 4 JDBC package: You should read Remote Access Questions section at http://www.hxtt.net/en/software/dbf/faq.html#remote .

  • JDBC-ODBC Bridge seems to slow down after a while

    Hi,
    I've got a weird problem going on with an application I'm writing. I hope someone can tell me what I'm doing wrong.
    The problem I'm encountering is in he code shown below. The function getAllGamesForATeam is creating a list of items in an ArrayList and passing it back to an Event handler so that I can put it in the session of a servlet. The first time I run this code, it is fast. Fast enough to use on a servlet. The second time it runs, it is MUCH slower...too slow to use on a servlet. The third time it runs, it gets even worse.
    I am using the JDBC-ODBC bridge to access my database which is in Access 97. I do have connection pooling enabled on the database. Still it is slow.
    If you have any ideas, I would appreciate it. Here's the code:
    // GameBean.java
    // A class to represent a Game in my College Hockey Program
    // Based on Team and League tables.
    package MyBeans;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.http.*;
    * <p>This is the Java bean used to get and display information about
    * items for sale in our web based store.
    * @version 1.0.0 08/13/2001
    * @author Kevin Yetman
    * @see DBBeanBase
    public class GameBean extends DBBeanBase
    * <p>Default constructor, creates an empty {@link GameBean}.
    public GameBean()
    super();
    * <p>Copy constructor. This constructor creates a {@link GameBean} object
    * that is initially populated with a copy of the {@link java.util.Map} specified
    * as a parameter to this constructor. All {@link java.util.Map} Maps should
    * implement a copy constructor.
    * @param copyThisMap the {@link Map} used to initialize this {@link GameBean} object.
    public GameBean(Map copyThisMap)
    super(copyThisMap);
    * <p>This constructor creates an {@link GameBean} object and
    * populates it with the fields in a {@link java.sql.ResultSet}.
    * @param rs The {@link java.sql.ResultSet} object used to populate
    * this class with information about an item.
    * @throws java.sql.SQLException if there is an error iterating the
    * {@link java.sql.ResultSet}.
    protected GameBean(ResultSet rs) throws SQLException
    super(rs);
    * <p>This constructor creates an {@link GameBean} object associated with the
    * specified item id. If there is no record in the data source with the
    * specified item id, an exception is thrown.
    * @param conneciton The {@link java.sql.Connection} object used to execute
    * the select statement that will retrieve the item information.
    * @param iLeagueId specifies the league id used to populate this object.
    * @throws java.sql.SQLException if there is an error selecting the item
    * information.
    * @throws java.lang.Exception if the item id is invalid.
    public GameBean(Connection connection, int iGameId) throws SQLException, Exception
    super();
    String strSQL="SELECT GameIndex, Month, Day, Year, HomeTeamIndex, VisitorTeamIndex, HomeTeamScoredFirst, LeagueGame, NeutralSiteGame, PlayoffGame, HomeTeamGoals, VisitorTeamGoals FROM Game WHERE GameIndex=" + iGameId;
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(strSQL);
    if (rs.next())
    populateFromResultSet(rs);
    else
    throw new Exception("Invalid game Id: " + iGameId);
    putInTeamNames(connection);
    * <p>This method returns the league's index.
    * @return the league's index.
    public void putInTeamNames(Connection connection)
    throws SQLException
    String strSQL="SELECT TeamName FROM Team WHERE TeamIndex=" + getHomeTeamIndex();
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(strSQL);
    if( rs.next() )
    put("HOMETEAMNAME", rs.getString("TeamName"));
    strSQL="SELECT TeamName FROM Team WHERE TeamIndex=" + getVisitorTeamIndex();
    rs=statement.executeQuery(strSQL);
    if( rs.next() )
    put("VISITORTEAMNAME", rs.getString("TeamName"));
    * <p>This method returns the league's index.
    * @return the league's index.
    public String getGameIndex()
    return get("GAMEINDEX").toString();
    * <p>This method returns the name of the league.
    * @return the name of the league.
    public String getMonth()
    return get("MONTH").toString();
    * <p>This method returns the name of the league.
    * @return the name of the league.
    public String getDay()
    return get("DAY").toString();
    * <p>This method returns the name of the league.
    * @return the name of the league.
    public String getYear()
    return get("YEAR").toString();
    * <p>This method returns the name of the league.
    * @return the name of the league.
    public String getHomeTeamName()
    return get("HOMETEAMNAME").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getVisitorTeamName()
    return get("VISITORTEAMNAME").toString();
    * <p>This method returns the name of the league.
    * @return the name of the league.
    public String getHomeTeamIndex()
    return get("HOMETEAMINDEX").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getVisitorTeamIndex()
    return get("VISITORTEAMINDEX").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getLeagueGame()
    return get("LEAGUEGAME").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getNeutralSiteGame()
    return get("NEUTRALSITEGAME").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getPlayoffGame()
    return get("PLAYOFFGAME").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getHomeTeamScoredFirst()
    return get("HOMETEAMSCOREDFIRST").toString();
    * <p>This method returns the league's nickname.
    * @return the league's nickname.
    public String getHomeTeamGoals()
    return get("HOMETEAMGOALS").toString();
    * <p>This method returns the league's automatic bids.
    * @return the league's automatic bids.
    public String getVisitorTeamGoals()
    return get("VISITORTEAMGOALS").toString();
    * <p>This method returns a textual representation of this {@link ItemBean}.
    * @return a textual representation of this {@link ItemBean}.
    public String toString()
    StringBuffer sb=new StringBuffer();
    sb.append("GameIndex: " + getGameIndex() + "\n");
    sb.append("HomeTeamScoredFirst: " + getHomeTeamScoredFirst() + "\n");
    sb.append("PlayoffGame: " + getPlayoffGame() + "\n");
    sb.append("LeagueGame: " + getLeagueGame() + "\n");
    sb.append("NeutralSiteGame: " + getNeutralSiteGame() + "\n");
    sb.append("HomeTeamIndex: " + getHomeTeamIndex() + "\n");
    sb.append("VisitorTeamIndex: " + getVisitorTeamIndex() + "\n");
    sb.append("HomeTeamName: " + getHomeTeamName() + "\n");
    sb.append("VisitorTeamName: " + getVisitorTeamName() + "\n");
    sb.append("Month: " + getMonth() + "\n");
    sb.append("Day: " + getDay() + "\n");
    sb.append("Year: " + getYear() + "\n");
    return sb.toString();
    * <p>This method returns a {@link java.util.Collection} of all of the teams
    * in the data source.
    * @param connection The {@link java.sql.Connection} object used to execute
    * the select statement that will retrieve the teams.
    * @return a {@link java.util.Collection} of all of the teams in the data source.
    * @throws java.sql.SQLException if there is an error selecting the items.
    public static Collection getAllGames(Connection connection) throws SQLException
    Collection col=new ArrayList(1100);
    String strSQL = "SELECT GameIndex, Month, Day, Year, HomeTeamIndex, VisitorTeamIndex, HomeTeamScoredFirst, LeagueGame, NeutralSiteGame, PlayoffGame, HomeTeamGoals, VisitorTeamGoals FROM Game";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(strSQL);
    while(rs.next())
    GameBean currentGame=new GameBean(rs);
    currentGame.putInTeamNames(connection);
    col.add(currentGame);
    return col;
    * <p>This method returns a {@link java.util.Collection} of all of the teams
    * in the data source.
    * @param connection The {@link java.sql.Connection} object used to execute
    * the select statement that will retrieve the teams.
    * @return a {@link java.util.Collection} of all of the teams in the data source.
    * @throws java.sql.SQLException if there is an error selecting the items.
    public static Collection getAllGamesForALeague(Connection connection, String leagueNickName) throws SQLException
    Collection col=new ArrayList(500);
    String strSQL = "SELECT LeagueIndex FROM League WHERE LeagueNickName='" + leagueNickName + "'";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(strSQL);
    int leagueIndex=-1;
    if( rs.next() )
    leagueIndex=rs.getInt("LeagueIndex");
    strSQL = "SELECT GameIndex, Month, Day, Year, HomeTeamIndex, VisitorTeamIndex, HomeTeamScoredFirst, LeagueGame, NeutralSiteGame, PlayoffGame, HomeTeamGoals, VisitorTeamGoals FROM Game";
    strSQL+=" WHERE (HomeTeamIndex IN (SELECT TeamIndex FROM Team WHERE LeagueIndex=" + leagueIndex + ")) OR";
    strSQL+=" (VisitorTeamIndex IN (SELECT TeamIndex FROM Team WHERE LeagueIndex=" + leagueIndex + "))";
    strSQL+=" ORDER BY Year, Month, Day";
    statement = connection.createStatement();
    rs = statement.executeQuery(strSQL);
    while(rs.next())
    GameBean currentGame=new GameBean(rs);
    currentGame.putInTeamNames(connection);
    System.out.println(currentGame.getGameIndex());
    col.add(currentGame);
    return col;
    * <p>This method returns a {@link java.util.Collection} of all of the teams
    * in the data source.
    * @param connection The {@link java.sql.Connection} object used to execute
    * the select statement that will retrieve the teams.
    * @return a {@link java.util.Collection} of all of the teams in the data source.
    * @throws java.sql.SQLException if there is an error selecting the items.
    public static Collection getAllGamesForATeam(Connection connection, String teamName)
    throws SQLException
    Collection col=new ArrayList(50);
    String strSQL = "SELECT TeamIndex FROM Team WHERE TeamName='" + teamName + "'";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(strSQL);
    int teamIndex=-1;
    if( rs.next() )
    teamIndex=rs.getInt("TeamIndex");
    strSQL = "SELECT GameIndex, Month, Day, Year, HomeTeamIndex, VisitorTeamIndex, HomeTeamScoredFirst, LeagueGame, NeutralSiteGame, PlayoffGame, HomeTeamGoals, VisitorTeamGoals FROM Game";
    strSQL+=" WHERE (HomeTeamIndex=" + teamIndex + ") OR";
    strSQL+=" (VisitorTeamIndex=" + teamIndex + ")";
    strSQL+=" ORDER BY Year, Month, Day";
    statement = connection.createStatement();
    rs = statement.executeQuery(strSQL);
    while(rs.next())
    GameBean currentGame=new GameBean(rs);
    currentGame.putInTeamNames(connection);
    col.add(currentGame);
    return col;
    // The unit test method public static void main(String[] args)
    // has been moved to ..\TestPrograms\TestItemBean.java so that this
    // class can be used in the package MyBeans.
    /////////////////////////////////// END OF FILE //////////////////////////////

    Where do you close the ResultSet?
    Where do you close the Statement?
    Presumably you only create one connection for all users or you close it somewhere.

  • Weblogic server using jdbc-odbc bridge

    I want to connect to database through jdbc-odbc bridge.I am using web logic server. When i creating new jdbc connection pool a error comes that driver class is not on classpath. how i rectify this problem? how I make weblogic to recognize sun.jdbc.odbc.JdbcOdbcDriver?

    like any other library...
    put the .jar file of the lib in the WEB-INF/lib of
    your webappWrong in so many ways.
    You don't add drivers to WEB-INF/lib if they're being acquired as datasources - the server needs access to the driver to create the data source. If you're not using a DataSource but materializing the connection directly, then this advice is semi-correct, but it's a crappy way to build a web app.
    You don't normally add a JAR for the Sun JDBC ODBC bridge anyway as it's present by default in their J2SE implementation.
    And finally, I think WebLogic doesn't use the Sun J2SE implementation anyway, so it's possible that the bridge is not available at all.
    So the correct answer is: Don't use the bridge driver. Acquire a driver for your specific database and use that. And make sure that it's available to the application server. If you absolutely must use the bridge driver, you're going to have to use the Sun J2SE implementation to run WebLogic - and I think you'll have to consult the WebLogic site for help with that.

  • To run a report from command line, when using jdbc-odbc bridge

    Hi,
    How to run a report from command line, when using jdbc-odbc bridge?
    Usually with tns, we do by "rwrun module=<> userid=<user>/<passwd>@tns".
    with odbc, we do by "rwrun module=<> userid=<user>/<passwd>@odbc:DSN"
    Please specify, what is command line arguments for jdbc-odbc bridge driver?
    Environment : Oracle 9i Report Builder on WinNT
    Database : Sybase
    Regards,
    Ramanan

    Hello Ramanan,
    Report Builder : connect JDBC Query in Report Builder is to through Connection Dialog in JDBC Query Editor. User can use a Sign on parameter (can use, default : P_JDBCPDS or can create new) to connect to JDBC Data Source. Connection once made will be mentioned and will be reused through out Reports Builder.
    JDBC PDS allows user to connect one or more same or different kind of databases.
    While running report through runtime or Server, user can pass the sign on parameter(connection string) value, like any other user parameter.
    Syntax for connection string : <username>/<password>@databaseURL . The syntax of database part of connection string depend on the type of JDBC Driver used to connect to Data Source while designing the JDBC Query. databaseURL refer to the location of the database and its format depend on the JDBCPDS river selected in design time while creating the JDBC Query.
    rwrun eg :
    rwrun report=jdbc_odbc.rdf destype=file desname=output.html desformat=html P_JDBCPDS=scott/tiger@database
    Server eg :
    http://server.com:8888/servlet/RWServlet?server=MyReportServer+report=jdbc_odbc.rdf+destype=cache+desformat=html+P_JDBCPDS=scott/tiger@database
    http :
    Please see ORACLE_HOME/reports/conf/jdbcpds.conf for more information.
    With Regards
    Reports Team

  • JDBC-ODBC bridge

    Hello,
    I'm using JDK1.5 and have a working connection to MySQL using JDBC. I now need to connect to Interbase database using ODBC and that's where I'm completely lost.
    Could somebody please tell me if I have to download a JDBC-ODBC bridge or if it's already in the package? Can JDBC-ODBC communicate with InterBase?
    Please help.
    Thank you,
    Victor.

    Uf you want the password stored in the ODBC DSN, you'll need to go through the back door. This isn't something Oracle makes easy because it has horrible security implications-- the password will be stroed in the registry in plain text.
    If you add a key "Password" with the value of your password to the registry where your DSN is, the ODBC driver will use that value to connect to the database. I don't recall the exact heirarchchy riht now, but a registry search for the name of your DSN ought to find it pretty quickly. As always, playing with your registry isn't recommended and may cause problems if you don't do it correctly.
    Justin

  • JDBC-ODBC Bridge to SPSS data files - Result Set Type is not supported

    Hello,
    As mentioned in the subject I am trying to read SPSS data files using the SPSS 32-Bit data driver, ODBC and the JDBC-ODBC Bridge.
    Using this SPSS Driver I manged to read the data directly into an MS-SQL Server using:
    SELECT [...] FROM
    OPENROWSET(''MSDASQL.1'',''DRIVER={SPSS 32-BIT Data Driver (*.sav)};DBQ=' SomePathWhereTheFilesAre';SERVER=NotTheServer'', ''SELECT 'SomeSPSSColumn' FROM "'SomeSPSSFileNameWithoutExt'"'') AS a
    This works fine!
    Using Access and an ODBC System DNS works for IMPORTING but NOT for LINKING.
    It is even possible to read the data using the very slow SPSS API.
    However, when it comes to JDBC-ODBC the below code does only work in part. The driver is loaded successfully, but when it comes to transferring data into the resultset object the error
    SQLState: null
    Result Set Type is not supported
    Vendor: 0
    occurs.
    The official answer from SPSS is to use .Net or to use their implementation with Python in their new version 14.0. But this is obviously not an option when you want to use only Java.
    Does anybody have experience with SPSS and JDBC-ODBC??? I have tried the possible ResultSet Types, which I took from:
    http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/rjvdsprp.htm
    and none of them worked.
    Thank you in advance for your ideas and input & stay happy!
    Here the code without all the rest of the class arround it:
    // Module:  SimpleSelect.java
    // Description: Test program for ODBC API interface.  This java application
    // will connect to a JDBC driver, issue a select statement
    // and display all result columns and rows
    // Product: JDBC to ODBC Bridge
    // Author:  Karl Moss
    // Date:  February, 1996
    // Copyright: 1990-1996 INTERSOLV, Inc.
    // This software contains confidential and proprietary
    // information of INTERSOLV, Inc.
    public static void main1() {
      String url   = "jdbc:odbc:SomeSystemDNS";
      String query = "SELECT SomeSPSSColumn FROM 'SomeSPSSFileName'";
      try {
        // Load the jdbc-odbc bridge driver
        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
        DriverManager.setLogStream(System.out);
        // Attempt to connect to a driver.  Each one
        // of the registered drivers will be loaded until
        // one is found that can process this URL
        Connection con = DriverManager.getConnection (url);
        // If we were unable to connect, an exception
        // would have been thrown.  So, if we get here,
        // we are successfully connected to the URL
        // Check for, and display and warnings generated
        // by the connect.
        checkForWarning (con.getWarnings ());
        // Get the DatabaseMetaData object and display
        // some information about the connection
        DatabaseMetaData dma = con.getMetaData ();
        System.out.println("\nConnected to " + dma.getURL());
        System.out.println("Driver       " +
          dma.getDriverName());
        System.out.println("Version      " +
          dma.getDriverVersion());
        System.out.println("");
        // Create a Statement object so we can submit
        // SQL statements to the driver
        Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY ,ResultSet.CONCUR_READ_ONLY);
        // Submit a query, creating a ResultSet object
        ResultSet rs = stmt.executeQuery (query);
        // Display all columns and rows from the result set
        dispResultSet (rs);
        // Close the result set
        rs.close();
        // Close the statement
        stmt.close();
        // Close the connection
        con.close();
      }

    Thank you for your reply StuDerby!
    Actually the above script was before, as you suggested, leaving the ResultSetTeype default. This did not work...
    I am getting gray hair with SPSS - in terms of connectivity and "integratebility" none of their solutions offered is sufficient from my point of view.
    Variable definitions can only be read by the slow API, data can only be read by Python or Microsoft Products... and if you want to combine both you are in big trouble. I can only assume that this is a company strategy to sell their Dimensions Platform to companies versus having companies developping their applications according to business needs.
    Thanks again for any furthur suggestions and I hope, that some SPSS Developper will see this post!
    Cheers!!

  • Problem using Jdbc-Odbc Bridge

    Hi,
    I am using Java 2 SDK and I am trying to access MS Access database on my machine using Jdbc-Odbc bridge. I have set up the DSN in ODBC. But I get the following error when I run my program -
    'No Suitable Driver'
    Here's my code snippet-
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    String dsn = "jdbc:odbc:DriverInfoDB";
    Connection con = DriverManager.getConnection(dsn,"","");
    con.setAutoCommit(false);
    Statement stmt;
    String query = null; // SQL select string
    ResultSet rs; // SQL query results
    stmt = con.createStatement();
    .....etc etc...
    Where is the error in this code??
    Help Needed!!
    Thanks
    Vivek.

    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection(dsn,"guest","guest");
    OR DriverManager.getConnection(dsn);
    System.out.println("Conection's opened");
    catch(ClassNotFoundException cnfe)
    System.err.println(cnfe);
    catch(SQLException sqle)
    System.err.println(sqle);
    try that code and double check you DSN Name . it's a good practice to greate a system DSN.
    i hope that helps.
    FEEL FREE TO ASK. WON'T BITE U
    ABDUL

Maybe you are looking for

  • Unlocked Australian 3G i-phone doesn't work abroad

    I recently purchased a factory unlocked i-phone from an Apple store in Australia. I am now travelling in Indonesia, however, my i-phone won't work with local SIM cards (I have tried several different carriers). I believed that my phone would work out

  • InfoObject 0ID_CHADAT is not available in version A

    Is there step by step procedures for activating this InfoObject.  The reason I plan to use it is because I have created a Delta enabled Generic Extractor using EQUI-AEDAT and feel that this is the ideal InfoObject to map to.  If incorrect please advi

  • ALBPM Enterprise SA 5.7 MP3 and Weblogic Express 9.2

    We are using ALBPM Enterprise SA 5.7 MP3 and Weblogic Express 9.2. We have the following questions: 1) Why, after assigning a Parametric Role to an user, we have to restart the portal in Weblogic before the user can log back into the system? When we

  • Send pdfs to different collections in iBooks 1.2

    I just downloaded the new version of iBooks 1.2 and find to have more than one collection. However, I cannot work out how to transfer the pdfs to each collection. Any guidance is appreciated. Thanks!

  • Rename the portal Help link in the portal

    I need to rename the help link in the portal masthead to some other name. Is there any option to change with out import the masthead par fil in to NWDS and hardcoding the  help link name.