jdbc

java setString() not working

。_饼干妹妹 提交于 2021-02-02 10:01:53
问题 try{is = new FileInputStream(new File(s)); PreparedStatement ps; ps= cn.prepareStatement("Update instructor set name ='?' ,gender ='?', image ='?' where instructorID =?"); JOptionPane.showMessageDialog(null, "5"); ps.setString(1,name); JOptionPane.showMessageDialog(null, "4"); ps.setString(2,gender); JOptionPane.showMessageDialog(null, "3"); ps.setBlob(3, is); JOptionPane.showMessageDialog(null, "2"); ps.setString(4, iden); JOptionPane.showMessageDialog(null, "1"); ps.executeUpdate();

java setString() not working

有些话、适合烂在心里 提交于 2021-02-02 10:01:16
问题 try{is = new FileInputStream(new File(s)); PreparedStatement ps; ps= cn.prepareStatement("Update instructor set name ='?' ,gender ='?', image ='?' where instructorID =?"); JOptionPane.showMessageDialog(null, "5"); ps.setString(1,name); JOptionPane.showMessageDialog(null, "4"); ps.setString(2,gender); JOptionPane.showMessageDialog(null, "3"); ps.setBlob(3, is); JOptionPane.showMessageDialog(null, "2"); ps.setString(4, iden); JOptionPane.showMessageDialog(null, "1"); ps.executeUpdate();

ORA-00933 SQL command not properly ended but good in SQL Developer

独自空忆成欢 提交于 2021-02-02 09:01:29
问题 I am hoping someone can find what is the issue with my query because I am unable to see fault in it and Oracle SQL Developer seems to run the same query as the code in my Java Swing Application just fine. My query in SQL Developer: SELECT ad.ID,ad.Script_Name,ad.Current_Status, ad.Issues_found_during_run,ad.Testers, ad.Run_Date,ad.Tools,u.fTag,u.role, dbms_lob.substr(u.avatar) FROM allData ad INNER JOIN users u ON u.fTag = ad.lastUserWhoUpdated GROUP BY ad.ID,ad.Script_Name,ad.Current_Status,

ORA-00933 SQL command not properly ended but good in SQL Developer

╄→гoц情女王★ 提交于 2021-02-02 08:59:30
问题 I am hoping someone can find what is the issue with my query because I am unable to see fault in it and Oracle SQL Developer seems to run the same query as the code in my Java Swing Application just fine. My query in SQL Developer: SELECT ad.ID,ad.Script_Name,ad.Current_Status, ad.Issues_found_during_run,ad.Testers, ad.Run_Date,ad.Tools,u.fTag,u.role, dbms_lob.substr(u.avatar) FROM allData ad INNER JOIN users u ON u.fTag = ad.lastUserWhoUpdated GROUP BY ad.ID,ad.Script_Name,ad.Current_Status,

ORA-00933 SQL command not properly ended but good in SQL Developer

有些话、适合烂在心里 提交于 2021-02-02 08:59:21
问题 I am hoping someone can find what is the issue with my query because I am unable to see fault in it and Oracle SQL Developer seems to run the same query as the code in my Java Swing Application just fine. My query in SQL Developer: SELECT ad.ID,ad.Script_Name,ad.Current_Status, ad.Issues_found_during_run,ad.Testers, ad.Run_Date,ad.Tools,u.fTag,u.role, dbms_lob.substr(u.avatar) FROM allData ad INNER JOIN users u ON u.fTag = ad.lastUserWhoUpdated GROUP BY ad.ID,ad.Script_Name,ad.Current_Status,

Connection timeout when reading Netezza from AWS Glue

倾然丶 夕夏残阳落幕 提交于 2021-01-29 19:11:01
问题 I am trying to use AWS Glue for pulling data from my on-premise Netezza database into S3. The code I have written so far (not complete) df = glueContext.read.format("jdbc")\ .option("driver", "org.netezza.Driver")\ .option("url", "jdbc:netezza://NetezzaHost01:5480/Netezza_DB")\ .option("dbtable", "ADMIN.table1")\ .option("user", "myUser")\ .option("password", "myPassword")\ .load() print(df.count()) I am using a custom JDBC driver jar since AWS Glue does not support Netezza natively (the

How to passing list data variable to store procedure and execute the store procedure?

偶尔善良 提交于 2021-01-29 14:31:58
问题 I have 8 variable list and collect them to variable ls in this below code : Workbook workbook = new Workbook("D:/excel file/Mapping Prod Matriks _Group Sales Commercial.xlsx"); com.aspose.cells.Worksheet worksheet = workbook.getWorksheets().get(0); com.aspose.cells.Cells cells = worksheet.getCells(); Range displayRange = cells.getMaxDisplayRange(); List<String> ParaObjGroup = new ArrayList<String>(); List<String> ParaObjCode = new ArrayList<String>(); List<String> ParaProdMatrixId = new

MariaDB SSL connection error: Unsupported record version Unknown-0.0

余生颓废 提交于 2021-01-29 09:11:17
问题 My environment: OS: centos 7.6.1810 database: 10.3.14-MariaDB jdbc driver: mariadb-java-client 2.4.1 jdbc parameter: jdbc:mysql://db_ip:3306/dbname?useUnicode=true&characterEncoding=utf8mb4&useSSL=true&trustServerCertificate=true java: openjdk version "1.8.0_201" ap server: wildfly 16 MariaDB SSL configuration tested below: mysql mysql --ssl MariaDB [mysql]> status -------------- mysql Ver 15.1 Distrib 10.3.14-MariaDB, for Linux (x86_64) using readline 5.1 Connection id: 68 Current database:

Error access two datasource with Spring Boot

我的未来我决定 提交于 2021-01-29 09:02:27
问题 I'm developing an APP that accesses two bases: Db2 and SQL Server with spring boot. When I try to access the second datasource the following error occurs: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class It is not a problem with the driver because when I squeeze the app to run with just one of the banks it works Follow below how the project is: application.properties: Conexao sqlserver spring

jdbc how to insert mysql SET type?

蹲街弑〆低调 提交于 2021-01-29 07:14:22
问题 Hi I have a code for table creating: create table clt (id bigint not null, sources set('A1', 'empty', 'A2', 'A3'), text varchar(50)); table was created successfully. now I'm trying to insert data: java.sql.PreparedStatement stmt = null; String query = "insert into clt (id, sources, text) values (?, ?, ?)"; stmt = conn.prepareStatement(query); int it = 0; stmt.setLong(++it, 25); stmt.setString(++it, "A1, A2"); stmt.setString(++it, "some text data"); stmt.executeUpdate(); and gettting an error