Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in output  RSS feed

 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello, I have created the following program in net beans(database connection). I set up odbc connection also. Data source name-student. But when i run the program, no output is displayed. can you please tell, why output is not displayed?
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check that the data got inserted in the database?
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhivya rajagopal wrote:
No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?

There should be a table created before you insert some data into it. Creating a table is a one time and it can be done manually by running the SQL queries.
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you mohamed. I created one table . and run the program, I get the following error:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhivya rajagopal wrote:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)

So the error message says what you are missing- user, password
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can spend sometime in reading this tutorial on JDBC
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!