Wiki source code of JDBC Snippets
Last modified by christoph_lechleitner@iteg_at on 2015-05-23 06.25:19
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
2.1 | 1 | == {{id name="JDBCSnippets-TypicalJDBCURLsandvalidationQueries"/}}Typical JDBC URLs and validation Queries == |
| |
1.1 | 2 | |
| |
2.1 | 3 | The JDBC URL links usually refer to what we presume to be the most recent product version at the time we googled the links, earlier versions might not support all URL parameters. |
| 4 | |||
| |
1.1 | 5 | |=((( |
| 6 | Database | ||
| 7 | )))|=((( | ||
| |
2.1 | 8 | Driver class name |
| 9 | )))|=((( | ||
| |
1.1 | 10 | JDBC URL Example |
| 11 | )))|=((( | ||
| |
2.1 | 12 | JDBC URL Links |
| 13 | )))|=((( | ||
| |
1.1 | 14 | validation Query recommendation |
| 15 | ))) | ||
| 16 | |((( | ||
| |
2.1 | 17 | Apache Derby |
| 18 | )))|((( | ||
| 19 | {{code language="none"}} | ||
| 20 | org.apache.derby.jdbc.EmbeddedDriver | ||
| 21 | {{/code}} | ||
| 22 | )))|((( | ||
| 23 | (% class="code" %) | ||
| 24 | ((( | ||
| 25 | jdbc:derby:[subsubprotocol:]MYDATABASE | ||
| 26 | ))) | ||
| 27 | )))|((( | ||
| 28 | [[Derby JDBC database connection URL>>url:http://db.apache.org/derby/docs/10.10/devguide/cdevdvlp17453.html||shape="rect"]] | ||
| 29 | )))|((( | ||
| 30 | |||
| 31 | ))) | ||
| 32 | |((( | ||
| |
1.1 | 33 | MySQL |
| 34 | )))|((( | ||
| 35 | {{code language="none"}} | ||
| |
2.1 | 36 | com.mysql.jdbc.Driver |
| 37 | {{/code}} | ||
| 38 | )))|((( | ||
| 39 | {{code language="none"}} | ||
| |
1.1 | 40 | jdbc:mysql://myserver:3306/MYDATABASE |
| 41 | {{/code}} | ||
| 42 | )))|((( | ||
| |
2.1 | 43 | [[Connector/J Reference>>url:http://dev.mysql.com/doc/refman/5.5/en/connector-j-reference-configuration-properties.html||shape="rect"]] |
| 44 | )))|((( | ||
| |
1.1 | 45 | {{code language="none"}} |
| 46 | SELECT 1 | ||
| 47 | {{/code}} | ||
| 48 | ))) | ||
| 49 | |((( | ||
| 50 | MS SQL Server | ||
| 51 | )))|((( | ||
| 52 | {{code language="none"}} | ||
| |
2.1 | 53 | com.microsoft.sqlserver.jdbc.SQLServerDriver |
| 54 | {{/code}} | ||
| 55 | )))|((( | ||
| 56 | {{code language="none"}} | ||
| |
1.1 | 57 | jdbc:sqlserver://myserver:1433;databaseName=MYDATABASE |
| 58 | {{/code}} | ||
| 59 | )))|((( | ||
| |
2.1 | 60 | [[Building the Connection URL>>url:http://msdn.microsoft.com/en-us/library/ms378428.aspx||shape="rect"]] |
| 61 | )))|((( | ||
| |
1.1 | 62 | SELECT 1 |
| 63 | ))) | ||
| 64 | |((( | ||
| 65 | Oracle | ||
| 66 | )))|((( | ||
| 67 | {{code language="none"}} | ||
| |
2.1 | 68 | oracle.jdbc.driver.OracleDriver |
| |
1.1 | 69 | {{/code}} |
| 70 | )))|((( | ||
| 71 | {{code language="none"}} | ||
| |
3.1 | 72 | jdbc:oracle:thin:@myserver:1521:MYTNS |
| |
2.1 | 73 | {{/code}} |
| 74 | )))|((( | ||
| 75 | [[Oracle JDBC Driver and URL Information (@razorsql.com)>>url:http://www.razorsql.com/docs/help_oracle.html||shape="rect"]] | ||
| 76 | )))|((( | ||
| 77 | {{code language="none"}} | ||
| |
1.1 | 78 | SELECT SYSDATE FROM DUAL |
| 79 | {{/code}} | ||
| 80 | ))) | ||
| 81 | |((( | ||
| 82 | PostgreSQL | ||
| 83 | )))|((( | ||
| |
2.1 | 84 | {{code language="none"}} |
| 85 | org.postgresql.Driver | ||
| 86 | {{/code}} | ||
| |
1.1 | 87 | )))|((( |
| |
4.1 | 88 | ##jdbc:postgresql:~/~/myserver:(% style="color: rgb(0,0,0);" %)5432(%%)/MYDATABASE## |
| |
2.1 | 89 | )))|((( |
| 90 | [[Connection Parameters>>url:http://jdbc.postgresql.org/documentation/91/connect.html#connection-parameters||shape="rect"]] | ||
| 91 | )))|((( | ||
| 92 | SELECT 1 | ||
| |
1.1 | 93 | ))) |
| 94 | |((( | ||
| 95 | SQLite | ||
| 96 | )))|((( | ||
| |
2.1 | 97 | {{code language="none"}} |
| 98 | org.sqlite.JDBC | ||
| 99 | {{/code}} | ||
| |
1.1 | 100 | )))|((( |
| |
2.1 | 101 | {{code language="none"}} |
| 102 | jdbc:sqlite:/var/foo/MYDATABASE.db | ||
| 103 | {{/code}} | ||
| 104 | )))|((( | ||
| 105 | - | ||
| 106 | )))|((( | ||
| |
1.1 | 107 | |
| 108 | ))) |