jdbc

I can't import the JDBC Client Driver from the derby package

一笑奈何 提交于 2021-02-10 14:21:12
问题 I have a Java Derby database running in Netbeans and I'm trying to connect to it using the JDBC driver. However, I cannot import the JDBC driver specifically from the org.apache.derby package. What I've done: My pom.xml file contains the following Maven repo's <!-- https://mvnrepository.com/artifact/org.apache.derby/derby --> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.15.1.3</version> <type>jar</type> </dependency> <!-- https://mvnrepository

Unable to connect to oracle database from groovy

为君一笑 提交于 2021-02-10 09:30:07
问题 Hi i am unable to connect to oracle database in groovy . I have used the following code in groovy console but getting the following compilation error unable to resolve class oracle.jdbc.driver.OracleTypes at line: 5, column: 1 I have used the following code import java.sql.Connection import java.sql.DriverManager import javax.sql.DataSource import groovy.sql.Sql import oracle.jdbc.driver.OracleTypes sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:databasename", "username", "password",

Unable to connect to oracle database from groovy

£可爱£侵袭症+ 提交于 2021-02-10 09:29:50
问题 Hi i am unable to connect to oracle database in groovy . I have used the following code in groovy console but getting the following compilation error unable to resolve class oracle.jdbc.driver.OracleTypes at line: 5, column: 1 I have used the following code import java.sql.Connection import java.sql.DriverManager import javax.sql.DataSource import groovy.sql.Sql import oracle.jdbc.driver.OracleTypes sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:databasename", "username", "password",

Disable oracle autocommit on close connection

依然范特西╮ 提交于 2021-02-10 08:42:11
问题 I have a question about Oracle autocommit on close connection event. Information from oracle docs(http://docs.oracle.com/cd/E16655_01/java.121/e17657.pdf): If the auto-commit mode is disabled and you close the connection without explicitly committing or rolling back your last changes, then an implicit COMMIT operation is run. So, I want to disable this feature programmatically in JDBC driver. I don't wan't do autocommit on connection close at least one transaction. Is it possible? P.S.

I am trying to extract an XMLTYPE column from an Oracle table using JDBC and having some issues

跟風遠走 提交于 2021-02-10 05:53:20
问题 I am trying to extract an XMLTYPE column from an Oracle table using JDBC. I have the query: select "XML_FILE" FROM "TABLE_NAME" and when I run the query in the Oracle SQL Developer, it returns back all the XMLTYPE rows completely fine. But, when I run the following Java code, and run the same query, I always get "null" returned for every column. I'm not sure what could be going wrong and I've tried doing many different things, but nothing has been working. Important note - the XMLTYPE fields

How to safely execute custom statements within JOOQ's `ExecuteListener`?

六眼飞鱼酱① 提交于 2021-02-10 05:24:38
问题 I have a custom ExecuteListener that executes additional statements before the statement JOOQ is currently looking at: @Override public void executeStart(ExecuteContext ctx) { if (ctx.type() != READ) { Timestamp nowTimestamp = Timestamp.from(Instant.now()); UUID user = auditFields.currentUserId(); // NOT the Postgres user! Connection conn = ctx.connection(); try (Statement auditUserStmt = conn.createStatement(); Statement auditTimestampStmt = conn.createStatement()) { // hand down context

How to safely execute custom statements within JOOQ's `ExecuteListener`?

笑着哭i 提交于 2021-02-10 05:24:05
问题 I have a custom ExecuteListener that executes additional statements before the statement JOOQ is currently looking at: @Override public void executeStart(ExecuteContext ctx) { if (ctx.type() != READ) { Timestamp nowTimestamp = Timestamp.from(Instant.now()); UUID user = auditFields.currentUserId(); // NOT the Postgres user! Connection conn = ctx.connection(); try (Statement auditUserStmt = conn.createStatement(); Statement auditTimestampStmt = conn.createStatement()) { // hand down context

SQLite JDBC driver on Android

谁都会走 提交于 2021-02-08 20:51:20
问题 I'm trying to use xerial sqlite-jdbc to manage my database in Android with no success.I'm getting an java.lang.NoClassDefFoundError: org.sqlite.SQLiteConnection exception.I've imported this dependency 'org.xerial:sqlite-jdbc:3.18.0' in my gradle. My code is as follows, try { Class.forName("org.sqlite.JDBC"); Connection connection = DriverManager.getConnection("jdbc:sqlite:hs.db"); } catch (ClassNotFoundException eString) {System.err.println("Could not init JDBC driver - driver not found"); }

ORA-06550: line 1, column 7: PLS-00201: identifier 'PAYMENT_UPDATE' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

扶醉桌前 提交于 2021-02-08 11:57:25
问题 I have a procedure to insert values into one table and update rows of another table. The procedure compiled without any errors. If I manually call it within PL/SQL codes, the tables are updated. CREATE OR REPLACE PROCEDURE payment_update (bId IN number, pType IN varchar2, pAmt IN number ) AS BEGIN INSERT INTO payment VALUES (PID_SEQ.NEXTVAL, bId, pType, (SELECT CURRENT_DATE FROM DUAL), pAmt); UPDATE booking SET payment_status = 'FP', paid = pAmt WHERE booking_id = bId; END; / I am trying to

Intermittent JDBC Broken Pipe and Link Failure

泪湿孤枕 提交于 2021-02-08 10:25:56
问题 Excepcion:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ... Caused by: java.net.SocketException: Broken pipe I have already read a lot of question similar to this one. So, before declaring this question 'unworthy' let me clarify some things My JDBC link is fully working. No problem of authentication Sql is up and running The max_connections , wich is 300, is never reached The concurrent thread connections are always between 5 and 9 Im using MySQL 5.0.95