jdbc

stored procedure is not displaying results in jsp

孤人 提交于 2021-02-11 12:54:26
问题 I am trying to execute results from my stored procedure and it is not displaying anything. I have played around with sql syntax query and nothing worked...when I do a normal select statement I get results from my tables, but so far nothing worked with my stored procedure...what am I not getting results ? I am using sql-server by the way <% Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String url = "jdbc:sqlserver://...."; String username = "something"; String password =

XPages JDBC connected to MS ACCESS DB, issue showing data in ViewPanel

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 12:47:21
问题 I am trying to connect XPagesJDBC.nsf to a simple MS Access database, it connects Successfully and i am able to perform the @JdbcInsert , Update, Delete. also able to execute SQL Query operations. But i am facing an issue while trying to showing data in ViewPanel control with JDBC Query datasource type. It give bellow error Error while reading the relational data Invalid Fetch Size and a long StackTrace, i am copying some part of stack trace bellow; I think this error is specific to MS Access

XPages JDBC connected to MS ACCESS DB, issue showing data in ViewPanel

孤者浪人 提交于 2021-02-11 12:46:45
问题 I am trying to connect XPagesJDBC.nsf to a simple MS Access database, it connects Successfully and i am able to perform the @JdbcInsert , Update, Delete. also able to execute SQL Query operations. But i am facing an issue while trying to showing data in ViewPanel control with JDBC Query datasource type. It give bellow error Error while reading the relational data Invalid Fetch Size and a long StackTrace, i am copying some part of stack trace bellow; I think this error is specific to MS Access

Problem with Db connection testing in java

廉价感情. 提交于 2021-02-11 12:40:13
问题 I tried to testing my Dao class but it return this error for the class DbConnection: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or in an application resource file: java.naming.factory.initial at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:691) at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) at java.naming/javax.naming.InitialContext.getURLOrDefaultInitCtx

What's the problem with deleting a row from database?

倖福魔咒の 提交于 2021-02-11 12:38:10
问题 I want to delete a row from my database, but it doesn't work. I've got 2 exception: - NumberFormatException: null (it's for the parseInt part in the Servlet) - PSQLException: ERROR: relation "patients" does not exist... but it does exist! Can u help me to solve my problem? DB.java (just the method) public int deletePatient(int patID) { try { if (conn != null) { String delete = "DELETE FROM \"Patients\" WHERE Patients.PatientID = ?"; PreparedStatement pstmt = conn.prepareStatement(delete);

Login failed for user '<token-identified principal>' but works in Data Studio

不问归期 提交于 2021-02-11 12:32:16
问题 I am trying to use my AD account to connect to the Azure SQL using Java 8, JDBC Driver, and my accessToken. When I use Data Studio using my AD Account, I can connect successfully to the Azure SQL DB. But when I use my Java Program then it gives me this error: Request processing failed; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '' My code abstract: SQLServerDataSource ds = new SQLServerDataSource(); ds.setServerName("NAME.database.windows.net");

Java SQL Select statement using several variables in WHERE clause

孤人 提交于 2021-02-11 09:17:11
问题 I am writing a simple program using UDP Sockets.I need to input the name of a patient and retrieve its details from the database. The name of the patient is entered in the Doctor class and sent to the Server Class. The Server class then execute a query to retrieve the details of the patient. The problem is in the SQL statement. When I used only the variable firstname it is working fine, but when I put the second variable lastname the PatientRecord variable is NULL. The Server Class : public

Using Update statement with MS Access 2010 database in JAVA

百般思念 提交于 2021-02-11 07:10:09
问题 Hi I am developing a small application for insurance domain. I am getting an error when I am using the update statement in my program. The error is net.ucanaccess.jdbc.UcanaccessSQLException: unexpected token: HALF java.lang.NullPointerException The code is btnUpdate = new JButton("UPDATE"); btnUpdate.setMnemonic('U'); btnUpdate.setFont(new Font("Times New Roman", Font.BOLD, 11)); GridBagConstraints gbc_btnUpdate = new GridBagConstraints(); gbc_btnUpdate.insets = new Insets(0, 0, 5, 5); gbc

Using Update statement with MS Access 2010 database in JAVA

浪尽此生 提交于 2021-02-11 07:09:27
问题 Hi I am developing a small application for insurance domain. I am getting an error when I am using the update statement in my program. The error is net.ucanaccess.jdbc.UcanaccessSQLException: unexpected token: HALF java.lang.NullPointerException The code is btnUpdate = new JButton("UPDATE"); btnUpdate.setMnemonic('U'); btnUpdate.setFont(new Font("Times New Roman", Font.BOLD, 11)); GridBagConstraints gbc_btnUpdate = new GridBagConstraints(); gbc_btnUpdate.insets = new Insets(0, 0, 5, 5); gbc

How do I update thousands of records into MySQL DB in milliseconds

一世执手 提交于 2021-02-10 16:55:29
问题 I want to update about 10K records into MySQL DB in less than a second. I have written below code which takes about 6-8 seconds to update a list of records into DB. public void updateResultList(List<?> list) { String user = "root"; String pass = "root"; String jdbcUrl = "jdbc:mysql://12.1.1.1/db_1?useSSL=false"; String driver = "com.mysql.jdbc.Driver"; PreparedStatement pstm = null; try { Class.forName(driver); Connection myConn = DriverManager.getConnection(jdbcUrl, user, pass); myConn