background preloader

Jdbc

Facebook Twitter

jTDS JDBC Driver. Jdbcgrabber - Project Hosting on Google Code. What is this thing? JdbcGrabber is a thin JDBC wrapper similar to the defunct P6Spy wrapper. With it, you can wrap a vendor's JDBC wrapper in order to capture diagnostic information about what kind of SQL is being executed by your application. The wrapper's pluggable architecture allows you to develop any kind of "sink" you like to process statements. Its original intention was to reverse engineer legacy applications inside corporations where documentation is scarce and the original developers are gone. The primary design objective of this wrapper is to be as unobtrusive as possible. Out-of-the box the wrapper comes with sinks to print SQL and the stack trace that called it to stdout or to capture it in a file. Here is an example of the nice graph you can create with this tool: Another JDBC wrapper?! There are several other JDBC wrappers out there, but I created another one for my use for several reasons: OK, I'm hooked.

Jdbc: You'd have this: Rows Returned with JDBC. There are two ways to influence the number of rows returned when getting data from a database using JDBC. One is the setFetchSize method, and the other is the setMaxRows method. Both of these methods appear as part of the statement and resultset classes. If set at the statement level it effects all resultsets that result from execution of the statement. There are three main reasons to want to change these from the driver default setting: To conserve memory in the Java application by reducing the memory required to store data returned from the database.

Reduction of wait time for obtaining the resultset when retrieving large amounts of data. According to Oracle their JDBC driver default fetchsize is 10. JDbMonitor - Monitor JDBC Performance For Slow SQL Queries. iSQL-Viewer - Independent SQL Tool. QuantumDB Eclipse Plugin. Eclipse SQL Explorer. Generating a database dump SQL Script from Java. The aim of this project is to generate an SQL script from an existing database such that the tables and data can be recreated exactly as it was. There are lots of reasons for having such a tool, for example: We want to transfer the development database from our machine to the client’s serverWe’re developing on different sites so we need to be able to duplicate database schemas and dataWe’re developing using one database type (SQLServer, Oracle, MySQL…) and we need to test and/or deploy on anotherWe want to be able to keep snapshots of the database schema and data in a version control system such as CVS in a form where we can easily compare versions Most database vendors provide a way of executing SQL scripts but often, exporting both the schema and data from a database as SQL can be difficult (SQLServer for example allows you to export the schema, but not—as far as we know—the data).

Background The first thing we need to do is to connect to the database. Notes Download Source.