Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OracleRdmsSpecifics needs to be public for connection wrapping within code #59

Open
GoogleCodeExporter opened this issue Mar 30, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Directly wrapping connection using ConnectionSpy(Connection conn, RdmsSpecifics 
specifics) is not possible because OracleRdmsSpecifics is package scoped. 

What is the expected output? What do you see instead?
proper logging of time and dates for Oracle utilizing to_date/timestamp.

What version of the product are you using? On what operating system?
log4jdbc4-1.2



Original issue reported on code.google.com by [email protected] on 14 Dec 2012 at 6:29

@GoogleCodeExporter
Copy link
Author

Good find. RdbmsSpecifics and all it's subclasses should probably be public, 
huh?

Original comment by [email protected] on 14 Dec 2012 at 7:56

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Or... possibly have the appropriate RdbmsSpecifics configured based on the 
driver within the Connection instance passed into the one arg constructor. 

// Something like this... not tested ;)

  public ConnectionSpy(Connection realConnection)
  {
    this(realConnection, findRdmsSpecifics(realConnection));
  }

   ... 

  private static RdbmsSpecifics findRdmsSpecifics(Connection realConnection){
        RdbmsSpecifics rdbmsSpecifics = DriverSpy.defaultRdbmsSpecifics;
        try {
            String driver = realConnection.getMetaData().getDriverName();
            if(DriverSpy.rdbmsSpecifics.containsKey(driver)){
                rdbmsSpecifics = (RdbmsSpecifics) DriverSpy.rdbmsSpecifics.get(driver);
            }
        } catch (SQLException e) {
            // Log something useful here
        }
        return rdbmsSpecifics;
  }

Original comment by [email protected] on 14 Dec 2012 at 8:25

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I like that idea.

Original comment by [email protected] on 14 Dec 2012 at 8:33

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Let me know if you are interested in adding any contributors. I'd be more than 
happy to make the change and also work on getting this into maven.

Original comment by [email protected] on 14 Dec 2012 at 8:41

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Why don't you work out a patch for your idea, test it and we'll see?

Original comment by [email protected] on 15 Dec 2012 at 9:48

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Sure

Original comment by [email protected] on 16 Dec 2012 at 3:51

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I worked out the patch and converted the build to maven. Not sure if you
want to switch to maven or not though. Let me know. I'd have to send you
the zip because i would need to be able to commit in order to modify the
directory structure. The maven build is a multimodule build that will build
the jars for both JDBC3 and 4 as well as generate a site, javadoc and
changeset report.

Original comment by [email protected] on 27 Dec 2012 at 3:40

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant